-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(tixati) Overhauled AHK script for v2
Rewrote the AutoHotKey script to be compatible with AHKv2.
- Loading branch information
1 parent
eafb7b0
commit d1cfb24
Showing
3 changed files
with
43 additions
and
32 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
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,29 +1,35 @@ | ||
$ErrorActionPreference = 'Stop' | ||
|
||
$packageName = 'tixati' | ||
$toolsDir = Split-Path -parent $MyInvocation.MyCommand.Definition | ||
$fileName = 'tixati-3.19-1.install.exe' | ||
$download_dir = "$Env:TEMP\chocolatey\$packageName\$Env:ChocolateyPackageVersion" | ||
$dlDir = "$Env:TEMP\chocolatey\$($Env:ChocolateyPackageName)\$($Env:ChocolateyPackageVersion)" | ||
|
||
$packageArgs = @{ | ||
packageName = $packageName | ||
fileFullPath = "$download_dir\$fileName" | ||
packageName = $Env:ChocolateyPackageName | ||
fileFullPath = Join-path $dlDir $fileName | ||
url = 'https://download1.tixati.com/download/tixati-3.19-1.win32-install.exe' | ||
url64bit = 'https://download1.tixati.com/download/tixati-3.19-1.win64-install.exe' | ||
checksum = 'aba530275d136a63e927807d75a3d5ceb30990d15eedf00a12f5bd247f79b5e0' | ||
checksum64 = 'c696960f8bdade39e3a73d6a7626dbd9ecb79f8c9335c8ea1220015a55627692' | ||
checksumType = 'sha256' | ||
checksumType64 = 'sha256' | ||
} | ||
|
||
Get-ChocolateyWebFile @packageArgs | ||
|
||
Write-Output "Running Autohotkey installer" | ||
$toolsPath = Split-Path $MyInvocation.MyCommand.Definition | ||
Autohotkey.exe $toolsPath\$packageName.ahk $packageArgs.fileFullPath | ||
# silent install requires AutoHotKey | ||
$ahkFile = Join-Path $toolsDir "$($Env:ChocolateyPackageName).ahk" | ||
$ahkProc = Start-Process -FilePath AutoHotkey.exe -ArgumentList "$ahkFile" -PassThru | ||
Write-Debug "AutoHotKey start time:`t$($ahkProc.StartTime.ToShortTimeString())" | ||
Write-Debug "AutoHotKey Process ID:`t$($ahkProc.Id)" | ||
|
||
Start-ChocolateyProcessAsAdmin -ExeToRun $packageArgs.fileFullPath | ||
|
||
$installLocation = Get-AppInstallLocation $packageName | ||
if ($installLocation) { | ||
Write-Host "$packageName installed to '$installLocation'" | ||
Register-Application "$installLocation\$packageName.exe" | ||
Write-Host "$packageName registered as $packageName" | ||
$installLocation = Get-AppInstallLocation $Env:ChocolateyPackageName | ||
if ($installLocation) { | ||
Write-Host "$($Env:ChocolateyPackageName) installed to '$installLocation'" | ||
Register-Application "$installLocation\$($Env:ChocolateyPackageName).exe" | ||
Write-Host "$($Env:ChocolateyPackageName) registered as $($Env:ChocolateyPackageName)" | ||
} | ||
else { | ||
Write-Warning "Can't find $($Env:ChocolateyPackageName) install location" | ||
} | ||
else { Write-Warning "Can't find $PackageName install location" } |
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,20 +1,25 @@ | ||
SetTitleMatchMode, RegEx | ||
exe_re = tixati-.+install.exe | ||
SetTitleMatchMode "RegEx" | ||
exe_re := "tixati-.+install.exe" | ||
|
||
Run %1% | ||
WinWait, ahk_exe %exe_re%,,20 | ||
IfNotEqual, ErrorLevel, 0, exit 1 | ||
ControlSend,, {ENTER}, ahk_exe %exe_re% | ||
If WinWait("ahk_exe " exe_re, , 20) | ||
ControlSend "{ENTER}",, "ahk_exe " exe_re | ||
Else | ||
exit 1 | ||
|
||
WinWait, ahk_exe %exe_re%, YES`, continue installation, 20 | ||
IfNotEqual, ErrorLevel, 0, exit 1 | ||
ControlSend,, {ENTER}, ahk_exe %exe_re% | ||
If WinWait("ahk_exe " exe_re, "YES`, continue installation", 20) | ||
ControlSend "{ENTER}",, "ahk_exe " exe_re | ||
Else | ||
exit 1 | ||
|
||
WinWait, ahk_exe %exe_re%, Install, 20 | ||
IfNotEqual, ErrorLevel, 0, exit 1 | ||
ControlSend,, {ENTER}, ahk_exe %exe_re% | ||
If WinWait("ahk_exe " exe_re, "Install", 20) | ||
ControlSend "{ENTER}",, "ahk_exe " exe_re | ||
Else | ||
exit 1 | ||
|
||
WinWait, ahk_exe %exe_re%, Installation is complete!, 20 | ||
IfNotEqual, ErrorLevel, 0, exit 1 | ||
WinActivate | ||
Send, {TAB}{ENTER} | ||
if WinWait("ahk_exe " exe_re, "Installation is complete!", 20) | ||
{ | ||
WinActivate | ||
Send "{TAB}{ENTER}" | ||
} | ||
Else | ||
exit 1 |