I like to automate a (silent) software installation, nothing fancy, selecting stuff and pressing buttons using a standard graphical deployment software like NSIS.
I want to make it robust; successful actions as well as errors, timeouts, etc. everything should be logged.
Given the code from the video below how would exactly approach this?
After finish, would you check if files/folders/reg keys had been created correctly, or is this not necessary?
As this is a typical AHK case of application for sure s.o. has some useful tips to share. any generic, stable, robust, consistent, easy to adapt code would be great.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance, Force
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetControlDelay, 50
Title := "Uninstall WebEx Software"
Run, WBXRemoveTool.exe ;, Min
; Wait for WebEx Uninstall Window to open
WinWait, % Title, Yes
; Hide the Window
; WinMinimize, % Title, Yes
; Click yes (yes to uninstall)
ControlClick, Button1, % Title, Yes
WinWait, % Title, Uninstall
;Hide the window
;WinMinimize, % Title, Uninstall
; Click Uninstall
ControlClick, Uninstall, % Title, Uninstall
; Loop and wait 1 second until the finished button becomes enabled
Loop {
Sleep, 1000
ControlGet, IsFinished, Enabled,, Button2, % Title
} Until IsFinished = 1
; Then click the Finished button
ControlClick, Button2, % Title