|
|
#1 |
|
Junior Member
Join Date: Jul 2003
Posts: 11
|
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 |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
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 Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2003
Posts: 11
|
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 |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
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 Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Never mind, this script is on there already:
http://nsis.sourceforge.net/archive/...instances=0,11 -Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jul 2003
Posts: 11
|
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.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|