views:

34

answers:

1

I'm developing an NSIS installer, to update a program that runs in background. Obviously, I'd like to send the program termination signals, because otherwise I repeatedly get a "can't write" error. How can I do this, with a limited overhead on installer size?

+1  A: 

If your app has a window with a unique class name, you could just send it WM_CLOSE/WM_QUIT or whatever message you need.

Or your app could register a local server COM object the uninstaller could call (The system plugin can call COM methods)

Another way to do this is for the program to create a named event and wait on it, the uninstaller would signal it, this would be the clue for the program to quit.

As a last resort, you could kill the process with one of several plugins: KillProcDLL, Processes plug-in, KillProc plug-in and NsProcess

Also, the Locked List plugin might be a better alternative.

Anders
Hmmm, ok. How do I send messages to my app from nsis?
CFP
Found it: http://www.nullsoft.com/free/nsis/makensis.htm#SendMessage
CFP