From 9097d31c4973b74903613790240ad2fb0b76db69 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Fri, 17 Feb 2017 22:09:49 +0000 Subject: [PATCH 1/5] Updated install AHK to deal with install and upgrade --- tools/veracryptInstall.ahk | 50 +++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/tools/veracryptInstall.ahk b/tools/veracryptInstall.ahk index e705fdc..021f22f 100644 --- a/tools/veracryptInstall.ahk +++ b/tools/veracryptInstall.ahk @@ -3,23 +3,39 @@ ; #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 +winTitleInstall = VeraCrypt Setup -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 +ControlClick, &Next >, %winTitleInstall%,,,, NA + +; Upgrade or Install +IfWinExist, %winTitleInstall%, upgraded in the location,, + ControlClick, Upgrade, %winTitleInstall%,,,, NA +else + ControlClick, &Install, %winTitleInstall%,,,, NA + +; Wait until the install process is finished +WinWait, %winTitleInstall% ahk_class #32770 +ControlClick, OK, %winTitleInstall%,,,, NA + +; Donation +IfWinExist, %winTitleInstall%, VeraCrypt has been successfully + ControlClick, &Finish, %winTitleInstall% + +; Help / manual suggestion +IfWinExist, %winTitleInstall%, If you have never used VeraCrypt before + ControlClick, &No, %winTitleInstall% + +; If doing an upgrade you are prompted to restart +IfWinExist, %winTitleInstall%, computer must be restarted + ControlClick, &No, %winTitleInstall% \ No newline at end of file From 9f1673d931faf64c2b23a816753d614fe3455a60 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Sun, 19 Feb 2017 21:38:08 +0000 Subject: [PATCH 2/5] Rearranged AHK code and fixed donation page hang --- tools/veracryptInstall.ahk | 42 ++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/tools/veracryptInstall.ahk b/tools/veracryptInstall.ahk index 021f22f..b858617 100644 --- a/tools/veracryptInstall.ahk +++ b/tools/veracryptInstall.ahk @@ -1,26 +1,36 @@ #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, %winTitleInstall%, , 300 WinActivate -BlockInput, Off +; BlockInput, Off ; License terms ControlClick, I &accept the license terms, %winTitleInstall%,,,, NA ControlClick, &Next >, %winTitleInstall%,,,, NA ; Type of install -ControlClick, &Next >, %winTitleInstall%,,,, NA +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 @@ -29,13 +39,23 @@ WinWait, %winTitleInstall% ahk_class #32770 ControlClick, OK, %winTitleInstall%,,,, NA ; Donation -IfWinExist, %winTitleInstall%, VeraCrypt has been successfully - ControlClick, &Finish, %winTitleInstall% - -; Help / manual suggestion -IfWinExist, %winTitleInstall%, If you have never used VeraCrypt before - ControlClick, &No, %winTitleInstall% +WinWait, %winTitleInstall%, donation, , 10 +if !(ErrorLevel) { + Sleep, 200 + ControlClick, &Finish, %winTitleInstall%,,,, NA +} ; If doing an upgrade you are prompted to restart -IfWinExist, %winTitleInstall%, computer must be restarted - ControlClick, &No, %winTitleInstall% \ No newline at end of file +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 + } +} From e3cb2955a6b651b68b2478bbd5cf487f4ab4fb59 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Sun, 19 Feb 2017 21:42:02 +0000 Subject: [PATCH 3/5] Fixed donation page hang and tidied up code --- tools/veracryptInstall.ahk | 42 ++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/tools/veracryptInstall.ahk b/tools/veracryptInstall.ahk index 021f22f..fb31102 100644 --- a/tools/veracryptInstall.ahk +++ b/tools/veracryptInstall.ahk @@ -1,26 +1,36 @@ #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, %winTitleInstall%, , 300 WinActivate -BlockInput, Off +; BlockInput, Off ; License terms ControlClick, I &accept the license terms, %winTitleInstall%,,,, NA ControlClick, &Next >, %winTitleInstall%,,,, NA ; Type of install -ControlClick, &Next >, %winTitleInstall%,,,, NA +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 @@ -29,13 +39,23 @@ WinWait, %winTitleInstall% ahk_class #32770 ControlClick, OK, %winTitleInstall%,,,, NA ; Donation -IfWinExist, %winTitleInstall%, VeraCrypt has been successfully - ControlClick, &Finish, %winTitleInstall% - -; Help / manual suggestion -IfWinExist, %winTitleInstall%, If you have never used VeraCrypt before - ControlClick, &No, %winTitleInstall% +WinWait, %winTitleInstall%, donation, , 10 +if !(ErrorLevel) { + Sleep, 200 + ControlClick, &Finish, %winTitleInstall%,,,, NA +} ; If doing an upgrade you are prompted to restart -IfWinExist, %winTitleInstall%, computer must be restarted - ControlClick, &No, %winTitleInstall% \ No newline at end of file +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 + } +} From bffd2a3675030c55562e35b21268943b259705dd Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Sun, 19 Feb 2017 21:43:58 +0000 Subject: [PATCH 4/5] Revert "Fixed donation page hang and tidied up code" This reverts commit e3cb2955a6b651b68b2478bbd5cf487f4ab4fb59. --- tools/veracryptInstall.ahk | 42 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/tools/veracryptInstall.ahk b/tools/veracryptInstall.ahk index fb31102..021f22f 100644 --- a/tools/veracryptInstall.ahk +++ b/tools/veracryptInstall.ahk @@ -1,36 +1,26 @@ #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, %winTitleInstall%, , 300 WinActivate -; BlockInput, Off +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 +ControlClick, &Next >, %winTitleInstall%,,,, NA ; Upgrade or Install IfWinExist, %winTitleInstall%, upgraded in the location,, -{ ControlClick, Upgrade, %winTitleInstall%,,,, NA - upgradeVeraCrypt = 1 -} else ControlClick, &Install, %winTitleInstall%,,,, NA @@ -39,23 +29,13 @@ WinWait, %winTitleInstall% ahk_class #32770 ControlClick, OK, %winTitleInstall%,,,, NA ; Donation -WinWait, %winTitleInstall%, donation, , 10 -if !(ErrorLevel) { - Sleep, 200 - ControlClick, &Finish, %winTitleInstall%,,,, NA -} +IfWinExist, %winTitleInstall%, VeraCrypt has been successfully + ControlClick, &Finish, %winTitleInstall% + +; Help / manual suggestion +IfWinExist, %winTitleInstall%, If you have never used VeraCrypt before + ControlClick, &No, %winTitleInstall% ; 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 - } -} +IfWinExist, %winTitleInstall%, computer must be restarted + ControlClick, &No, %winTitleInstall% \ No newline at end of file From 80414f495bdb7d9851b7b4567c25af71b85a0b38 Mon Sep 17 00:00:00 2001 From: Paul Broadwith Date: Sun, 19 Feb 2017 21:48:52 +0000 Subject: [PATCH 5/5] Update veracryptInstall.ahk --- tools/veracryptInstall.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/veracryptInstall.ahk b/tools/veracryptInstall.ahk index b858617..fb31102 100644 --- a/tools/veracryptInstall.ahk +++ b/tools/veracryptInstall.ahk @@ -1,6 +1,6 @@ #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