-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from pauby/fix_donation_page_hang
Fix donation page hang
- Loading branch information
Showing
1 changed file
with
54 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,61 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
#NoTrayIcon | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
;#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. | ||
SetTitleMatchMode, 1 | ||
SetControlDelay -1 | ||
|
||
winTitleInstall = VeraCrypt Setup | ||
upgradeVeraCrypt = 0 | ||
|
||
WinWait, VeraCrypt Setup 1.19, , 60 | ||
WinWait, %winTitleInstall%, , 300 | ||
WinActivate | ||
BlockInput On | ||
Send !a | ||
Send !n | ||
Send !n | ||
Send !i | ||
BlockInput Off | ||
WinWait, VeraCrypt Setup ahk_class #32770 | ||
WinActivate | ||
IfWinActive | ||
Send {Enter} | ||
Sleep, 100 | ||
Send !f | ||
WinWait, VeraCrypt Setup ahk_class #32770 | ||
WinActivate | ||
IfWinActive | ||
Send !n | ||
; BlockInput, Off | ||
|
||
; License terms | ||
ControlClick, I &accept the license terms, %winTitleInstall%,,,, NA | ||
ControlClick, &Next >, %winTitleInstall%,,,, NA | ||
|
||
; Type of install | ||
WinWait, %winTitleInstall%, Wizard Mode, , 2 | ||
if !(ErrorLevel) { | ||
ControlClick, &Next >, %winTitleInstall%,,,, NA | ||
} | ||
|
||
Sleep, 200 | ||
|
||
; Upgrade or Install | ||
IfWinExist, %winTitleInstall%, upgraded in the location,, | ||
{ | ||
ControlClick, Upgrade, %winTitleInstall%,,,, NA | ||
upgradeVeraCrypt = 1 | ||
} | ||
else | ||
ControlClick, &Install, %winTitleInstall%,,,, NA | ||
|
||
; Wait until the install process is finished | ||
WinWait, %winTitleInstall% ahk_class #32770 | ||
ControlClick, OK, %winTitleInstall%,,,, NA | ||
|
||
; Donation | ||
WinWait, %winTitleInstall%, donation, , 10 | ||
if !(ErrorLevel) { | ||
Sleep, 200 | ||
ControlClick, &Finish, %winTitleInstall%,,,, NA | ||
} | ||
|
||
; If doing an upgrade you are prompted to restart | ||
if (upgradeVeraCrypt) { | ||
WinWait, %winTitleInstall%, computer must be restarted, , 2 | ||
if !(ErrorLevel) { | ||
ControlClick, &No, %winTitleInstall%,,,, NA | ||
} | ||
} | ||
else { | ||
; Help / manual suggestion | ||
WinWait, %winTitleInstall%, If you have never used VeraCrypt before, , 2 | ||
if !(ErrorLevel) { | ||
ControlClick, &No, %winTitleInstall%,,,, NA | ||
} | ||
} |