Jump to content

Autoit script unable to process last command after running for an hour


Go to solution Solved by JoeN99,

Recommended Posts

Hello  -  I am new to using Autoitv3 and am running into a problem for which I am hoping one of you experts might have a solution.  The program I am installing with the Autoit script uses an older version of InstallShield and the Autoit Info does not see any of the controls or text on any of my program’s windows.  All of the windows of my program have the same text in the Window Titles (all have the "A Installer" title). 

My problem:  

The Autoit script for installing the product  runs  fine until the last window (the one that appears after the program has run successfully for about an hour).

When the program gets to that last window, it does not go any further – seems to wait for me to issue a command.   Listed below is the code I have tried.  What would you suggest I do to get my script to recognize that it needs to continue onto the last screen and click Next button after the hour long install is done?  

;These are the commands that successfully kick off my program install
sleep(2000)
Send("!n")
sleep(2000)
Send("!n")

; These are the commands that fail get the program to access the final window after it had run for an hour or so

sleep(300000)

WinActivate("A Installer")

WinWaitActive("A Installer")

sleep(2000)

Send("!n")

 

Thanks,

Joe

 

 

   

Link to comment
Share on other sites

  • Moderators

JoeN99,

Welcome to the AutoIt forum. :)

But please pay attention to where you post - the "Developer Chat" section where you started this thread is not for general support questions. I have moved the thread for you, but would ask you to be more careful in future. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Although your commands have worked, they are not too fool proof.

Using sleep between send commands is very unreliable.  You should be waiting for your next expectation before kicking off the next command.  What if someone clicks off the install program?  What if something running takes focus?

WinExists()
WinActivate()
ControlSend()
ControlClick()
Link to comment
Share on other sites

No, unfortunately the text cannot be viewed by the Autoit Info program  - only the Title is viewed.  The Info does list title,class, position, size, style, exstyle and handle - but that information is the same for each window when my program runs. 

  • Would you be able to provide any examples of what script commands that could resolve the issue might look like in the script?

 

Melba23, Thank you for moving my thread for me.

Link to comment
Share on other sites

You may need to extract the installer and run setup.exe directly.  I'm not sure how the file is packaged.  If it's called setup.exe try running

setup /r

Install.  Afterwards go to your c:windows folder and look for setup.iss.  Move that to the install folder.  Uninstall the app and then run

setup /s

Link to comment
Share on other sites

To get params:

setup.exe /?

Even if the silent options are available, depending on the developers of the actual app, there may be some input require.

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

My executable is named install.exe but unfortunately install /? or install /r both yield an error saying that they are invalid command line options.   Seems the version the install was built in does not support them.

--- Would there be another way for the install program to recognize that it needs to continue onto the last screen and click the Next button after the install has been running for awhile?  

Thanks.  

Link to comment
Share on other sites

  • Solution

When I unzipped the exe, it did not contain a setup exe or any other exe I could run directly.

In meantime, I tried some other tests and found a way for the last buttons of my program to be pressed.  I was using too small a sleep.   Also, when I added a msgbox to the end, I found that it has focus on last window of my program.  I added timeout to it and then instructed it to click the Next and Finished buttons and it performed those steps consistently.     

** Issue is now resolved

My thanks to all of you for assisting me in finding a solution .  :)

sleep(1080000) ; sleep 18 minutes from start of run at last command

MsgBox($MB_ICONQUESTION, "A Installer", "Script is about to press the Finished button",10)
sleep(2000)
Send("!n")
sleep(2000)
Send("!f")

Link to comment
Share on other sites

Sleeps would hardy be the best answer.

WinWait with a timeout would be WAY better.  Not to mention looping for the finish button, and then looping for the finish button to be enabled would be way better also.

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...