I created a simple if else to download the autohotkey v1 executable without installing, allowing to run ahkv1.
it may be better to pass this as a function option like @param download:=0 but nonetheless it should provide a more flexible path for using ahkv1 remotely.
if !FileExist(ahkv1runtime) {
; personally, I find my documents to be a safe place to download without windows defender massive flags
; feel free to use something different
if !FileExist(A_MyDocuments "\Autohotkey.exe") {
try {
; i hosted ahkv1 exe in a random github repo
Download("https://github.com/samfisherirl/download-Autohotkey-v2-Documentation/releases/download/v2/AutoHotkeyU64.exe",
A_MyDocuments "\Autohotkey.exe")
ahkv1runtime := A_MyDocuments "\Autohotkey.exe"
} catch {
throw Error("Could not find AutoHotkey v1 runtime")
}
} else {
ahkv1runtime := A_MyDocuments "\Autohotkey.exe"
}
}
I created a simple if else to download the autohotkey v1 executable without installing, allowing to run ahkv1.
it may be better to pass this as a function option like
@param download:=0
but nonetheless it should provide a more flexible path for using ahkv1 remotely.