End process before attempting to copy files

I am developing an NSIS installer to update a program that is running in the background. Obviously, I would like to send signals to terminate the program, because otherwise I get a "can't write" error repeatedly. How can I do this, with limited installer size overhead?

+2


a source to share


1 answer


If your application has a window with a unique class name, you can simply send it to WM_CLOSE / WM_QUIT or whatever message you like.

Or your application can register a local server COM object that the uninstaller can invoke (a system plugin can invoke COM methods)

Another way to do this is a program to create a named event and wait on it, the uninstaller will signal this, this will be the key to shutting down the program.



As a last resort, you can kill a process with one of several plugins: KillProcDLL , Process Plugins , KillProc Plugin, and NsProcess

Also, the Locked List plugin might be a more suitable alternative .

+1


a source







All Articles