PDA

View Full Version : Find if my application is running and if so send WM_CLOSE to it


grzech
7th December 2006, 06:41
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.

bholliger
7th December 2006, 08:18
Have a look at the wiki:

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

Cheers

Bruno

grzech
7th December 2006, 09:24
Thanks, that looks exactly what I need. :)

Swapan Das
8th December 2006, 10:09
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