mmsajid
3rd December 2008 10:38 UTC
Closing an existing application from NSIS befor installation starts.
Hi,
It would be great if someone can answer the below question.
How can I identify if the application(MyApp.exe) is running and if it is running I would like to close it before my installation begins.
Thanks for reading the question.
barx
3rd December 2008 11:08 UTC
to kill the application:
ExecWait `taskkill /im MyApp.exe`
mmsajid
3rd December 2008 11:28 UTC
Excellent !!!
Thanks Barx...
Anders
3rd December 2008 20:14 UTC
thats probably not the best solution, taskkill does not exist on all systems. You are probably better off checking for a mutex or window class and tell the user to close down your app
barx
4th December 2008 13:20 UTC
I agree but ... do you know how to do this ?
Animaether
4th December 2008 14:57 UTC
In its most basic form...
_retry:
FindWindow $0 "Class or Titlebar text"
IntCmp $0 0 _done
MessageBox MB_OK "Please close [application]"
goto _retry
_done: