Sign in to follow this  
Followers 0
tes5884

Kill RunWait in While loop?

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Edited by DicatoroftheUSA

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Thanks

use ProcessExists to check if the.. well, if the process exists

Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

"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

Share this post


Link to post
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
Sign in to follow this  
Followers 0