|
|
#1 |
|
Member
Join Date: Aug 2007
Posts: 75
|
If process exists?
Can someone show me an example script of
If something.exe exists, do something I don't remember the plug-in or syntax for that thank you |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
That's not plugin, it's the included LogicLib header (LogicLib.nsh).
A forum search should help you a lot. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Oct 2007
Location: Xi'an, China
Posts: 194
|
Re: If process exists?
1.The FindProcDLL & KillProcDLL Plugins
FindProcDLL::FindProc "something.exe" Pop $R0 IntCmp $R0 1 0 Next MessageBox MB_ICONSTOP|MB_YESNO|MB_DEFBUTTON2 'The process "something.exe" is exist,do you want to kill it or quit?' IDYES +2 Abort Next: KillProcDLL::KillProc "something.exe" 2.The ProcessWork Plugin Push $R9 Loop: Push "something.exe" ProcessWork::ExistsProcess Pop $R0 IntCmp $R0 0 Done MessageBox MB_RETRYCANCEL|MB_ICONSTOP 'The process "something.exe" is exist.click [retry] to stop it or [cancel] to cancel setup.' IDCANCEL Exit Push "something.exe" ProcessWork::KillProcess Sleep 1000 Goto Loop Exit: Abort Done: Pop $R0 |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Oct 2007
Location: Xi'an, China
Posts: 194
|
If you want to do different things while a file is exist or not,you can use the command "IfFileExist":
IfFileExist "$WINDIR\Notepad.exe" Exist Not Exist: ;Something want to do if file exist Not: You can find it in NSIS Users Manual. An NSIS fan from China, my name is Jia Ke (pinyin). Email: jiake@vip.qq.com Messenger: jiake@live.in QQ (Chinese IM): 550771955 |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Mar 2008
Posts: 129
|
And the example using LogicLib. I prefer this cause it is little more structured.
code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|