Jump to content

App install with variable text boxes


Recommended Posts

I am attempting to create a passive install of a program.

I am using the Winwaitactive command along with the send commands. It seems to work pretty well except for at the end on some of the computers the last dialog box is different. Example, On some installs it displays that the install completed correctly and waits for an enter keystroke. On others it asks if you would like a reboot. Is there an if statement or something to deal with a variable prompt?

Edited by uamike
Link to comment
Share on other sites

;WinExists("tittle",["text"])
If WinExists("Installer","Installer that says succesfuly done")=1 Then ;Just moddify the tittle of the window, and the text
;Do the actions
EndIf
If WinExists("Installer","Installer that says to reboot")=1 Then ;Just moddify the tittle of the window, and the text
;Do the actions
EndIf

That's just a simple example on how I would do it, you can also use select/case, or maybe switch.

Conditional runs are something important, i use them all the time :mellow:

Edited by jiglei
Link to comment
Share on other sites

Thanks for the reply. That looked promising but it seems to not wait for the window to become active. It just immediately finishes the script and ends leaving a prompt. Here is the code I am trying to make work

Run("CiscoCCXReports.exe")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Welcome to the InstallShield Wizard for Cisco")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please read the following license agreement carefully.")
Send("!y")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please select the drive where you would like to install Cisco")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup will add program icons")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please enter the Cisco Unified CCX server hostname")
Send("10.1.1.1")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup has enough information to start copying the program files.")
Send("!n")
WinWaitActive("Desktop Shortcut", "Would you like to create a shortcut")
Send("!y")
If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") = 1 Then
    Send("{DOWN}")
    Send("{ENTER}")
EndIf
If WinActive("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified") = 1 Then
    Send("{ENTER}")
EndIf
Exit

I have tried WinExists and WinActive. It seems to me like it needs to wait for the next active window after the desktop shortcut and then query it for the text that way it will know what to send. I have no clue how to do this though.

Link to comment
Share on other sites

  • Moderators

uamike,

Try waiting until the dialogs exist before attempting to choose between them - something like this:

WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please read the following license agreement carefully.")
Send("!y")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please select the drive where you would like to install Cisco")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup will add program icons")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Please enter the Cisco Unified CCX server hostname")
Send("10.1.1.1")
Send("!n")
WinWaitActive("Cisco Unified CCX Historical Reports Setup", "Setup has enough information to start copying the program files.")
Send("!n")
WinWaitActive("Desktop Shortcut", "Would you like to create a shortcut")
Send("!y")

; Wait until one or other version of the window exists
Do
    Sleep(10)
Until WinExists("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Or _
    WinExists("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified")
; Now choose which one appeared
If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Then
    Send("{DOWN}")
    Send("{ENTER}")
Else
    Send("{ENTER}")
EndIf

Exit

Does that work? :mellow:

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

; Wait until one or other version of the window exists

Do

Sleep(10)

Until WinExists("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Or _

WinExists("Cisco Unified CCX Historical Reports Setup", "Setup has finished installing Cisco Unified")

; Now choose which one appeared

If WinActive("Cisco Unified CCX Historical Reports Setup", "Before you can use the program, you must restart") Then

Send("{DOWN}")

Send("{ENTER}")

Else

Send("{ENTER}")

EndIf

Exit

[/autoit]

Does that work? :mellow:

M23

Yes that works. Awesome thanks a lot.

Did you check to see if your install program has command line support? That may be a better way to go.

Yes I checked. This is a wrapped installshield install. It includes more then one program to install. I used the "/s /SMS /f2C:\CCXinstall.log" switches. On a couple machines it installed just fine this way but on the one that was requesting a reboot, it acted like it installed just fine. The log file showed a successful install but it does not get installed. Cisco is slow in making some of their software easily deployable. The switches were not in their documentation and are just some generic InstallShield switches.
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...