Archive: Check if running an close?


Check if running an close?
Since I give the user the option (you know how stupid end users are) to start the application after install and then they try and reinstall (who knows why), they get an error. is there a way I can shut down the current application onInit or something so it will just re - install over the old one? I get this error:

error opening the file for writing


What kind of file is it?
There is a plugin on the NSIS Archive called killproc which you could use, but it terminates applications and does not shut them down properly (not like as if the user clicked save and then close.)

-Stu


Wow! An answer anyone can understand
For windows. When you put your mouse over the application in the task bar you should get a window name. If not, find the window name. Use this function and it should close the application. I did it with the onInit because I wanted to close the application before the re-installed.

Function ".onInit"
Call CloseIt
FunctionEnd

Function CloseIt
Push $0
loop:
FindWindow $0 "" "Window Name"
IntCmp $0 0 done
SendMessage $0 16 0 0
Sleep 100
Goto loop
done:
Pop $0
FunctionEnd


That's a helpful script.

Please post it on the NSIS Archive:
http://nsis.sourceforge.net/archive/nsisweb.php

(If a similar script does not already exist)

-Stu


Never mind, this script is on there already:
http://nsis.sourceforge.net/archive/...instances=0,11

-Stu


I found it on this forum
It was a pretty hard find though. Lots of BS to sift through. So whomever supplied it thank you.