开发者

Terminating a process before trying to copy files

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜