Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 25th July 2003, 17:55   #1
mikemanczur
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
mikemanczur is offline   Reply With Quote
Old 25th July 2003, 20:28   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 28th July 2003, 16:51   #3
mikemanczur
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
mikemanczur is offline   Reply With Quote
Old 28th July 2003, 18:17   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 28th July 2003, 18:18   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
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
Afrow UK is offline   Reply With Quote
Old 28th July 2003, 18:51   #6
mikemanczur
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.
mikemanczur is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump