Archive: Find if my application is running and if so send WM_CLOSE to it


Find if my application is running and if so send WM_CLOSE to it
Hi all,

Before starting instalation or uninstalation I would like to check if my program is already running and if so close it. Normally I would do it by calling FindWindow and sending WM_CLOSE message to it.

How can I do it from NSIS Installer?

Thank you.


Have a look at the wiki:

http://nsis.sourceforge.net/Close/exit_a_program

Cheers

Bruno


Thanks, that looks exactly what I need. :)


For your further reference, you can try this also:

Function .onInit
; ------ At the time of installation Check if already MyProg.exe running:
FindProcDLL::FindProc "MyProg.exe"
StrCmp $R0 1 0 +3
MessageBox MB_ICONINFORMATION|MB_OK "Please Exit from MyProg program and then re-run this Installer"
Quit
FunctionEnd