Jump to content

Kill RunWait in While loop?


Recommended Posts

Hi Everyone,

I'm obviously a newb. Any help would be appreciated.

I made a application that let's me check a bunch of boxes and it installs applications based on my selection.

The reason I chose RunWait is because I don't want multiple apps to attempt to install at once.

My question is, if an app install crashes I can't quit the script, because it's waiting for the install to finish. How would i use a $kill button, or something similar to exit and kill the script?

http://pastebin.com/PY99UTZ7 <- this is the entire script.

Thanks!

$button = GUICtrlCreateButton("Install", 83, 332, 100, 30, -1, -1)

While 1
$nMsg = GUIGetMsg()
if $nMsg = $button Then

if GUICtrlRead($vlc) = $GUI_Checked Then
RunWait("vlc-2.0.2-win32.exe /S")
EndIf
If $nMsg = $GUI_EVENT_CLOSE then Exit
WEnd
Edited by tes5884
Link to comment
Share on other sites

Just use run, and then use the PID to manipulate it however you want via timeout, hotkey, whatever.

Something like

$iPID=run("whatever.exe")

while 1

sleep(100)

if _condition($iPID)=1 then exitloop

wend

Would I then have to figure a timeout value for each application? So figure out how long each install would take?

Thanks

Link to comment
Share on other sites

"timeout" not gonna work,,, depend on computer speed

or u can check the title,,, sometimes there is clues... event the app progress,,, example ghost32..

go check Window Management in Help File :)

The others way,,, check control text or status text (if exist)... go to Help File again...

Edited by rvn
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...