StMaSi Posted July 31, 2012 Share Posted July 31, 2012 So, I've started using AutoIt and am completely amazed at what you can accomplish with this tool...it's nothing short of incredible! Anyway, I've created a script that will launch an installer, then click through all the appropriate buttons, through all the differring windows that appear, through to the end of the installation process. Here's where I'm running into an issue...on rare occassions, I'm running into an issue where the second window in can differ in text content and button placement, but not always. What I need to figure out is how to perform an action based on the title and content of a window. I know how to use the WinWaitActive to wait for the appropriate window to appear, but is there a way I can use that (or another function) to do something based on the window? Perhaps an if/then or something similar? Thanx. Link to comment Share on other sites More sharing options...
spudw2k Posted July 31, 2012 Share Posted July 31, 2012 The possibilities are endless, but your requirements are not totally clear. You can certain make logic choices (if...then...etc) and there are various functions that may provide the information you are looking for. Can you give more detail as to the desired result? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
StMaSi Posted July 31, 2012 Author Share Posted July 31, 2012 So, here's the "more detail" portion about what I want to do. The stuff within the curved brackets are what I can't figure out... Run("app_srvrapp_pathsetup.exe") If {specific_window_#1_appears} Then WinWaitActive("Setup", "There is another process already running...") ControlClick("Setup", "OK", "[ID:2]") {exit} ElseIf {specific_window_#2_appears} Then WinWaitActive("Driver Installer", "Welcome to the driver installer...") ControlClick("Driver Installer", "&Next >", "[ID:1]") WinWaitActive("Driver Installer", "Click next to continue...") ControlClick("Driver Installer", "&Next >", "[ID:1]") WinWaitActive("Driver Installer", "Click finish to complete...") ControlClick("Driver Installer", "&Finish", "[ID:6]") EndIf Thanx. Link to comment Share on other sites More sharing options...
spudw2k Posted August 1, 2012 Share Posted August 1, 2012 WinGetTitle can be used to accomplish the "specific_window..." task. If WinGetTitle("desired window title") Then There is no need to exit from an if statement in AutoIt, unless you desire to end a function, in which case you could use return and the desired return value....but I assume in your case you don't need to so just ignore it. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 1, 2012 Moderators Share Posted August 1, 2012 Hi, StMaSi. What is the driver you're trying to install? Many standard drivers come with built-in switches for silent installs. This may take away the headache of trying click through the windows to the end of the install. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
StMaSi Posted August 1, 2012 Author Share Posted August 1, 2012 (edited) Unfortunately, no silent install for this proprietary driver. For whatever reason, the script doesn't progress past the first window...it just appears to hang. The window is present and active, so I can't understand why this isn't working. Am I missing something? $var1 = RegRead("HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstallS3 USB Installer v1.96.0", "DisplayName") Run(" app_srvr app_dir test S3 s3_usb_04.01.011 setup_v1_10.exe") ;<- {spaces for readability} If $var1 = "S3 USB Installer v1.96.0" Then WinWaitActive("S3 USB Installer Setup", "Click Finish to close this wizard.") ControlClick("S3 USB Installer Setup", "&Finish", "[ID:1]") Else If WinGetTitle("Setup", "The installation/uninstallation of 'S3 USB Installer' is already running!") Then WinWaitActive("Setup", "The installation/uninstallation of 'S3 USB Installer' is already running!") ControlClick("Setup", "OK", "[ID:2]") ElseIf WinGetTitle("S3 USB Installer Setup", "Please close all open hardware installation wizards before you continue!") Then WinWaitActive("S3 USB Installer Setup", "Please close all open hardware installation wizards before you continue!") ControlClick("S3 USB Installer Setup", "&Next >", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Setup was completed successfully.") ControlClick("S3 USB Installer Setup", "&Next >", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Please disconnect and reconnect the device you want to install and turn it on.") ControlClick("S3 USB Installer Setup", "&Finish", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Do you want to exit this wizard now and connect the device later?") ControlClick("S3 USB Installer Setup", "&Yes", "[ID:6]") ElseIf WinGetTitle("S3 USB Installer Setup", "This wizard will guide you through the installation of S3 USB Installer v1.96.0.") Then WinWaitActive("S3 USB Installer Setup", "This wizard will guide you through the installation of S3 USB Installer v1.96.0.") ControlClick("S3 USB Installer Setup", "&Next >", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Setup will install S3 USB Installer v1.96.0 in the following folder.") ControlClick("S3 USB Installer Setup", "&Install", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Setup was completed successfully.") ControlClick("S3 USB Installer Setup", "&Next >", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Please disconnect and reconnect the device you want to install and turn it on.") ControlClick("S3 USB Installer Setup", "&Finish", "[ID:1]") WinWaitActive("S3 USB Installer Setup", "Do you want to exit this wizard now and connect the device later?") ControlClick("S3 USB Installer Setup", "&Yes", "[ID:6]") EndIf EndIf Edited August 1, 2012 by StMaSi Link to comment Share on other sites More sharing options...
StMaSi Posted August 1, 2012 Author Share Posted August 1, 2012 Buehler... Buehler... Buehler... Just kidding. Seriously though...any help? Thanx again. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 1, 2012 Moderators Share Posted August 1, 2012 StMaSi, Please do not bump your own threads within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer eventually. Or if not, tough! 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...
StMaSi Posted August 1, 2012 Author Share Posted August 1, 2012 Sorry. Won't happen again. Thanx. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 1, 2012 Moderators Share Posted August 1, 2012 StMaSi, No problem. 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...
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