dwaltosz Posted January 23, 2015 Posted January 23, 2015 (edited) I am currently trying to run a .exe and I can get it to run but when I get to the 1st window it wont click through the steps automatically it stops at the 1st window and wont go any further here is my code any Ideas??? #RequireAdmin run("C:Usersdavid.waltoszDesktopAutoit programsXXX.exe") Local $hWnd = WinWait("Autoit - InstallShield Wizard", "") WinActivate($hWnd) ControlFocus($hWnd, "", "Button1") ControlClick($hWnd, "", "Button1") WinWait("Autoit - InstallShield Wizard", "") WinActivate("Autoit - InstallShield Wizard", "") ControlClick("DAutoit- InstallShield Wizard", "", 1000) ControlClick("Autoit - InstallShield Wizard", "", 1) WinWait("DAutoit InstallShield Wizard", "") WinActivate("Autoit - InstallShield Wizard", "") ControlClick("Autoit - InstallShield Wizard", "", 1) WinWait("DAutoit- InstallShield Wizard", "") WinActivate("Autoit - InstallShield Wizard", "") ControlClick("DAutoit- InstallShield Wizard", "", 1) WinWait("Autoit - InstallShield Wizard", "") WinActivate("Autoit - InstallShield Wizard", "") ControlClick("Autoit - InstallShield Wizard", "", 1) Edited January 23, 2015 by dwaltosz
MikahS Posted January 23, 2015 Posted January 23, 2015 (edited) Welcome to the AutoIt forum dwaltosz! Just to make things easier on all of us, when posting code please use code tags like [ autoit ] ;code goes here [ /autoit ] (remove the spaces). Or you can use the A in the blue box in the toolbar. like so: Func Test() ;comment EndFunc Also, have you had a chance to try out using the Au3 window info tool? This could give you valuable information on Ctrl ID's that need clicked, and could help with titles, etc. Edited January 23, 2015 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
dwaltosz Posted January 23, 2015 Author Posted January 23, 2015 sorry for the confusion and yes I am using the Au3 window info tool titles and Ctrl ID's are right
jdelaney Posted January 23, 2015 Posted January 23, 2015 (edited) Add logging on each step so you know exactly where it's hanging up. It could be that your window is found, activated, and the control's aren't present yet...so you aren't actually clicking anything. Edited January 23, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
MikahS Posted January 23, 2015 Posted January 23, 2015 Putting some error handling in would probably help you ten fold. As, I do not know what you mean when you say "it stops at the 1st window and wont go any further". Can you maybe explain where you think it is stopping, better yet do the error handling and you will know exactly where it is having trouble. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
Solution jdelaney Posted January 23, 2015 Solution Posted January 23, 2015 There are also window states to take into consideration. Just because you found your window doesn't mean it's enabled. You need to create functions to not only look for windows, but also wait for the state of the window. Same is true of the controls. You should loop until the control is present and enabled. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
MikahS Posted January 23, 2015 Posted January 23, 2015 jdelaney is very right. Using: WinGetState WinSetState Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ
dwaltosz Posted January 23, 2015 Author Posted January 23, 2015 so when you execute the program it will run and start the installation but when it get the first window to click next it wont click the button I have tried every combination that I can think of
jdelaney Posted January 23, 2015 Posted January 23, 2015 Of course, these suggestions are to only help get the script to do exactly what you need more often. It's all about getting error rates down. You can always add sleeps between steps, and that will generally help as well, but won't take into consideration a Computer with maxed out ram...maybe that comp needs a longer sleep. That's why it's best (my opinion) to create functions to loop for some max amount of time for the states. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
jdelaney Posted January 23, 2015 Posted January 23, 2015 so when you execute the program it will run and start the installation but when it get the first window to click next it wont click the button I have tried every combination that I can think of You have no idea where it's stopping. Add the logging, and provide it to us. Right now you are only guessing, which would mean anything we suggest would be meaningless. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
jaberwacky Posted January 23, 2015 Posted January 23, 2015 "ControlClick("DAutoit- InstallShield Wizard", "", 1000)" What is DAutoit? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
dwaltosz Posted January 23, 2015 Author Posted January 23, 2015 sorry I posted a fo-name for my program or the title if you need the real name I can give you tat as well
Moderators JLogan3o13 Posted January 23, 2015 Moderators Posted January 23, 2015 Whatever it is, if it's an Installshield Wizard it supports silent install parameters. Why not use these? P.S., the real app name always helps "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!
dwaltosz Posted January 23, 2015 Author Posted January 23, 2015 thanks all for your help it looks like all needed to do was add in a 10sec sleep and it gave it enough time to install
Moderators JLogan3o13 Posted January 23, 2015 Moderators Posted January 23, 2015 What is "it"? There may still be a better way than a bunch of Sends "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!
jdelaney Posted January 23, 2015 Posted January 23, 2015 thanks all for your help it looks like all needed to do was add in a 10sec sleep and it gave it enough time to install This one time, sure, but what about next time when you cpu is overloaded...might need 20 seconds. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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