Skip to content
⌘ NSIS Forum Archive

Close a service

6 posts

Gluck#

Close a service

I 'm trying to portabilize a service.
It hasn't a command "Quit" (stay open till windows close).

But if I shutdown my computer, I cannot run the code after EXECWAIT...

I can have only the focus on this service.
Is there a keyboad shortcut to close the service and execute the final part of my code?
Anders#
What does close service even mean?

You can stop a service and then delete it, there is no such thing as close.
Gluck#
Example:

I have an app, Notepad, that miss the command "Quit".
So, I can start, but I cannot close it.

If I shut down the computer, how can I execute the code after ExecWait to recover registry, appdata etc?

If I swith off the program with ctrl+alt+canc the code is execute? NSIS knows notepad is closing and run the remaining instructions?

THE PROBLEM: How can I execute the remaining code after close my app?
Anders#
First you talk about service and now Notepad, make up your mind.

You can send the WM_CLOSE message to Notepad and it will close unless it has unsaved data. If you don't care about saving data you can just kill the process.
Gluck#
It's a service, I have made notepad as example...
Anyway your idea about alt+f4 could be good.
Kill the process with NSIS? (KillProcess) I don't know how to do to jump to the line...
What is better, KilProc, KillProcDLL or nsProcess?
Are you sure that NSIS see the service in closing with alt+f4?

thanks