Autohotkey Updater Script Topic is solved

Report problems with documented functionality
Elderon
Posts: 1
Joined: 13 Dec 2016, 18:26

Autohotkey Updater Script

13 Dec 2016, 18:36

I'm not sure if this is the right spot to post this, but the script to automatically update autohotkey is broken.

The script located here: https://autohotkey.com/download/Update.ahk

First the variables on the top are incorrect, the one in the script does not use the URL_Base variable and instead uses UpdateURL which is not defined
URL_Version = %UpdateURL%/1.1/version.txt <--Incorrect Variable
URL_Version = %URL_Base%/1.1/version.txt <--Fixed Variable

Then, the try function to check for the current version is looking for VersionURL which is not defined.

; Retrieve latest version number. <--VersionURL isn't defined
try
{
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", VersionURL, false), whr.Send()
version := whr.ResponseText
if !(version ~= "^\d+\.\d")
throw ; 404?
}

Should be the following:
whr.Open("GET", URL_Version, false), whr.Send()
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: Autohotkey Updater Script

13 Dec 2016, 23:23

That's a silly mistake. Fortunately, Update.ahk is obsolete.

The check for updates is built into AutoHotkey Setup (Installer.ahk), which you already have if you've installed AutoHotkey. It's in the Start menu and Control Panel. If there is an update, the first option in setup will be "Download v1.1.xx.xx" instead of "Reinstall". Clicking it does the same thing as clicking "Yes" in Update.ahk.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 38 guests