uamike Posted June 24, 2010 Share Posted June 24, 2010 (edited) I am attempting to create a passive install of a program. I am using the Winwaitactive command along with the send commands. It seems to work pretty well except for at the end on some of the computers the last dialog box is different. Example, On some installs it displays that the install completed correctly and waits for an enter keystroke. On others it asks if you would like a reboot. Is there an if statement or something to deal with a variable prompt? Edited June 24, 2010 by uamike Link to comment Share on other sites More sharing options...
jiglei Posted June 24, 2010 Share Posted June 24, 2010 (edited) ;WinExists("tittle",["text"]) If WinExists("Installer","Installer that says succesfuly done")=1 Then ;Just moddify the tittle of the window, and the text ;Do the actions EndIf If WinExists("Installer","Installer that says to reboot")=1 Then ;Just moddify the tittle of the window, and the text ;Do the actions EndIf That's just a simple example on how I would do it, you can also use select/case, or maybe switch. Conditional runs are something important, i use them all the time Edited June 24, 2010 by jiglei Link to comment Share on other sites More sharing options...
uamike Posted June 24, 2010 Author Share Posted June 24, 2010 Thanks for the reply. That looked promising but it seems to not wait for the window to become active. It just immediately finishes the script and ends leaving a prompt. Here is the code I am trying to make work Run("CiscoCCXReports.exe") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Welcome to the InstallShield Wizard for Cisco") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please read the following license agreement carefully.") Send("!y") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please select the drive where you would like to install Cisco") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup will add program icons") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please enter the Cisco Unified CCX server hostname") Send("10.1.1.1") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup has enough information to start copying the program files.") Send("!n") WinWaitActive("Desktop Shortcut", "Would you like to create a shortcut") Send("!y") If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") = 1 Then Send("{DOWN}") Send("{ENTER}") EndIf If WinActive("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified") = 1 Then Send("{ENTER}") EndIf Exit I have tried WinExists and WinActive. It seems to me like it needs to wait for the next active window after the desktop shortcut and then query it for the text that way it will know what to send. I have no clue how to do this though. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2010 Moderators Share Posted June 24, 2010 uamike, Try waiting until the dialogs exist before attempting to choose between them - something like this: WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please read the following license agreement carefully.") Send("!y") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please select the drive where you would like to install Cisco") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup will add program icons") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please enter the Cisco Unified CCX server hostname") Send("10.1.1.1") Send("!n") WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup has enough information to start copying the program files.") Send("!n") WinWaitActive("Desktop Shortcut", "Would you like to create a shortcut") Send("!y") ; Wait until one or other version of the window exists Do Sleep(10) Until WinExists("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Or _ WinExists("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified") ; Now choose which one appeared If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Then Send("{DOWN}") Send("{ENTER}") Else Send("{ENTER}") EndIf Exit Does that work? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Bert Posted June 24, 2010 Share Posted June 24, 2010 Did you check to see if your install program has command line support? That may be a better way to go. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
uamike Posted June 24, 2010 Author Share Posted June 24, 2010 ; Wait until one or other version of the window exists Do Sleep(10) Until WinExists("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Or _ WinExists("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified") ; Now choose which one appeared If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Then Send("{DOWN}") Send("{ENTER}") Else Send("{ENTER}") EndIf Exit [/autoit] Does that work? M23 Yes that works. Awesome thanks a lot. Did you check to see if your install program has command line support? That may be a better way to go. Yes I checked. This is a wrapped installshield install. It includes more then one program to install. I used the "/s /SMS /f2C:\CCXinstall.log" switches. On a couple machines it installed just fine this way but on the one that was requesting a reboot, it acted like it installed just fine. The log file showed a successful install but it does not get installed. Cisco is slow in making some of their software easily deployable. The switches were not in their documentation and are just some generic InstallShield switches. 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