FoxZilla Posted August 5, 2006 Share Posted August 5, 2006 Hi, I found this great program just some time ago, and I'm now trying to make a script that would install all the basic programs (Winrar, Firefox, Google Earth..) that I want after fresh Windows install. How can I make the script to alert if some of the WinWaitActive fails after the timeout? Like a message box with Retry, Continue (and skip to the next program) and Cancel? So: Something odd happens with application A --> WinWaitActive fails. PC beeps and message box pops up. If the install has been put out of focus for example by firewall, user can refocus the window and click Retry. If the install fails/whatever, user can Continue, making the script to move on to application B. Could this be done in the beginning of the script only once, or do I have to write all this after every WinWaitActive? Thank you and sorry for my english! Link to comment Share on other sites More sharing options...
i542 Posted August 5, 2006 Share Posted August 5, 2006 Is that what you looking for: $win = WinWaitActive("Newbie help - AutoIt Forums - Mozzila Firefox","",10) If $win = 0 Then $msg = MsgBox(18,"Warning","WinWaitActive falied.") Switch $msg Case 3 ;abort Case 4 ;retry Case 5 ;ignore EndSwitch EndIf i542 I can do signature me. Link to comment Share on other sites More sharing options...
FoxZilla Posted August 5, 2006 Author Share Posted August 5, 2006 (edited) Im not sure what you mean by this: Switch $msg Case 3 ;abort Case 4 ;retry Case 5 ;ignore EndSwitch Did I say Im a newbie? Anyway, I could of course do the MsgBox manually after every WinWaitActive, but what a mess would that be! I mean, I cant do it like this: Run("winzip90.exe") $win = WinWaitActive("WinZip® 9.0 SR-1 Setup") If $win = 0 Then $msg = MsgBox(18,"Warning","WinWaitActive falied.") EndIf If $msg = "retry" (dont have the numbers here) Then $win (<-- not sure if thats right either, but you know what i mean?) If $msg = "skip" Then $Firefox If $msg = "cancel" Then Exit $Firefox = Run("firefoxinstall.exe") And so on... Hmm well, afterall I _could_ do it like that, but I guess (and hope) it isnt the smartest way Sorry I know Im not good at explaining this, especially when I've just started learning (am I even at the right track?). EDIT: Oh yeah, theres about 10 dialog boxes at the Winzip install, and putting that to every one of them doesnt seem.. right. Edited August 5, 2006 by FoxZilla Link to comment Share on other sites More sharing options...
Briegel Posted August 5, 2006 Share Posted August 5, 2006 Take a look at helpfile 'Switch...Case...EndSwitch' (BETA only). Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now