Archive: ExecWait with timeout?


ExecWait with timeout?
Hey all,

Im running an external application from my installer using ExecWait, this app should do its task in around 10-20 seconds, but there is always a chance it could hang, freeze, etc and that could also freeze my installer.

Is there a way to run ExecWait but with a timeout? So for example NSIS will continue if ExecWait doesnt finish in 40 seconds.

Thanks! :D


Hello. I see 2 options. First, you could run your App with just "Exec", followed by "Sleep 40000". This would pause you installer for 40 seconds after the Exec command.

Option 2, would be to use something like AutoIt (http://www.autoitscript.com/autoit3/) which would give you added functionality like checking for that App's presence, window title, etc... You could then shut it down cleanly, or forcefully if needed before continuing.

Hope this helps.


Thanks Jnuw,

One thing i forgot to mention: I need to get the apps exit code if it does finish in time, so Exec wont do :(

I will check out autoit, but it could run into problems when running dos apps or processes without windows, etc