Sign in to follow this  
Followers 0
dwaltosz

What Now

16 posts in this topic

#1 ·  Posted (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 by dwaltosz

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 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

 

Share this post


Link to post
Share on other sites

sorry for the confusion and yes I am using the Au3 window info tool titles and Ctrl ID's are right

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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.

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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

 

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

What is "it"? There may still be a better way than a bunch of Sends


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0