Skip to content

Commit

Permalink
Merge pull request #6 from pauby/fix_donation_page_hang
Browse files Browse the repository at this point in the history
Fix donation page hang
  • Loading branch information
kendaleiv authored Mar 5, 2017
2 parents 1fced0b + 80414f4 commit d57fa80
Showing 1 changed file with 54 additions and 18 deletions.
72 changes: 54 additions & 18 deletions tools/veracryptInstall.ahk
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
}
}

0 comments on commit d57fa80

Please sign in to comment.