foruok
17th August 2005 08:50 UTC
detect a soft run or not before NSIS uninstall
I'd made a NSIS installer,it will generate an uninstaller when the user run it.I want to know whether my software is in use before the user uninstall it. If my software is running, uninstaller should notify the user to close it before uninstall.
What shall I do?
I can't find the function to enumerate the processes on client system with NSIS script language.
Thanks.
Afrow UK
17th August 2005 11:06 UTC
You can try the FindProcDLL plugin which you can get on the NSIS Wiki:
http://nsis.sourceforge.net/wiki/Find_Process_By_Name
If you want to cut down on space (e.g. not use a DLL) you can try FindWindow instead...
FindWindow $R0 "" "application title"
IsWindow $R0 0 +3
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "Close blah?" IDRETRY -2
Abort
-Stu
foruok
18th August 2005 04:27 UTC
Afrow UK:
thanks a lot.
This problem had been resolved.
I make a little program with C(enumerate and search certain process),then call it with ExecShell.
I have another question.
In NSIS manual,some explains about function FindWindow like this:
FindWindow user_var(hwnd output) windowclass [windowtitle] [windowparent] [childafter]
If I don't know the "windowsclass" and "windowtitle" ,they will be generated by system when some app run. e.g.,when I install a protocol driver without microsoft's digital authentication,client OS will pop up some windows to notify the user:"this driver has no digital authentication,continue or abort or get the authentication now". I want to capture these windows,then send close message(or other message,such as WM_LBUTTONDOWN) to them
. I don't want to see these windows,I will try to close them by some message.
I will use NSIS to install a driver.....
I'm poor in English,sorry.