Archive: Closing an existing application from NSIS befor installation starts.


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.


to kill the application:
ExecWait `taskkill /im MyApp.exe`


Excellent !!!
Thanks Barx...


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


I agree but ... do you know how to do this ?


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: