Jump to content

What Now


 Share

Go to solution Solved by jdelaney,

Recommended Posts

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 by dwaltosz
Link to comment
Share on other sites

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 by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Link to comment
Share on other sites

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 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.
Link to comment
Share on other sites

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 ~ getENVvars
My 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

 

Link to comment
Share on other sites

  • Solution

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.
Link to comment
Share on other sites

jdelaney is very right. Using:

WinGetState
WinSetState

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My 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

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...