Skip to content
⌘ NSIS Forum Archive

Cycle of seaching process

7 posts

Хамик#

Cycle of seaching process

How create the cycle of searching process? Example during 5 sec. If process find then next to code else error.
Anders#
To sleep on a custom page you can use a nsDialog timer, to sleep on the InstFiles page you can use the sleep instruction.

There are several plugins to check for processes, take a look at the wiki...
stass#
!include "nsProcess.nsh" 
loop: 
${nsProcess::FindProcess} "App.exe" $R0 
StrCmp $R0 0 0 +4 
${nsProcess::KillProcess} "App.exe" $R0 
Sleep 100 
Goto loop 
JasonFriday13#
Another version with an absolute goto from loop:
!include "nsProcess.nsh" 
loop: 
${nsProcess::FindProcess} "App.exe" $R0 
StrCmp $R0 0 0 break
${nsProcess::KillProcess} "App.exe" $R0 
Sleep 100 
Goto loop
break: 
Anders#
Originally Posted by JasonFriday13 View Post
Another version with an absolute goto from loop:
Correct, you should not use relative jumps over macros!