Error trying to download the V1 and V2 files with current version number
Re: Error trying to download the V1 and V2 files with current version number
I feel that... 99% of my stuff is still v1.1
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Error trying to download the V1 and V2 files with current version number
All the files e.g this one won't work with URLDownloadToFile.
https://www.autohotkey.com/assets/images/ahk_wallpaper_reduced.jpg
Think it's related to this issue with the challenge pages from Cloudflare, one way around it might be a different user agent.
https://www.autohotkey.com/assets/images/ahk_wallpaper_reduced.jpg
Think it's related to this issue with the challenge pages from Cloudflare, one way around it might be a different user agent.
itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
Re: Error trying to download the V1 and V2 files with current version number
I havent forgotten this. I even tried with the autohotkey user agent in postman and it worked fine. For the life of me I cannot tell what it is. unless this is something much lower level like how AHK actually impliments under the hood that is now being subverted by OS. but thats pretty difficult to accept.
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter
Re: Error trying to download the V1 and V2 files with current version number
@lexikos Any ideas? We're not sure if it's the server configs or if it's AHK...
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Error trying to download the V1 and V2 files with current version number
Hi @tank and @joedf,
Thanks for your continuing efforts on this...much appreciated! Hopefully, @lexikos can provide some ideas to help resolve the problem. Regards, Joe
Thanks for your continuing efforts on this...much appreciated! Hopefully, @lexikos can provide some ideas to help resolve the problem. Regards, Joe
Re: Error trying to download the V1 and V2 files with current version number
What would I know? Download just uses a few Internet functions from wininet, as anyone can see.
Re: Error trying to download the V1 and V2 files with current version number
This problem affects the download prompt caused by #Requires AutoHotkey ... as well, which fails with error "Download failed."
The failure is caused by InternetOpenUrl which fails with error ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED, so it appears there is some kind of problem with the certificate.
Downloading via a GET request with Msxml2.XMLHTTP doesn't seem to be affected.
The failure is caused by InternetOpenUrl which fails with error ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED, so it appears there is some kind of problem with the certificate.
Downloading via a GET request with Msxml2.XMLHTTP doesn't seem to be affected.
Re: Error trying to download the V1 and V2 files with current version number
I’ve since made changes to the Ahk2Exe Updater to avoid this problem. Mpress is now downloaded from GitHub.TAC109 wrote: ↑01 May 2024, 00:51I’m also having problems using UrlDownloadToFile on https://www.autohotkey.com/mpress/mpress.219.zip, used in the Ahk2Exe Updater.
Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Error trying to download the V1 and V2 files with current version number
Hi Descolada,Descolada wrote:Downloading via a GET request with Msxml2.XMLHTTP doesn't seem to be affected.
Could you post a V1 and/or V2 code snippet with that method? Thanks much, Joe
Re: Error trying to download the V1 and V2 files with current version number
@JoeWinograd
If you only need the version number without downloading a file:
Download to file (variant 1):
Download to file (variant 2):
EDIT: improved variant 2 speed.
If you only need the version number without downloading a file:
Code: Select all
req := ComObject("Msxml2.XMLHTTP")
req.open("GET", "https://www.autohotkey.com/download/2.0/version.txt", 0)
req.send()
if req.status == 200
MsgBox "AHK 2.0 version: " req.responseText
else
MsgBox "Failed to get AHK version"
Code: Select all
DownloadURL("https://www.autohotkey.com/download/2.1/AutoHotkey_2.1-alpha.12_setup.exe")
ExitApp
DownloadURL(url, filename?) {
local oStream, req := ComObject("Msxml2.XMLHTTP")
req.open("GET", url, true)
req.send()
while req.readyState != 4
Sleep 100
if req.status == 200 {
oStream := ComObject("ADODB.Stream")
oStream.Open()
oStream.Type := 1
oStream.Write(req.responseBody)
oStream.SaveToFile(filename ?? StrSplit(url, "/")[-1], 2)
oStream.Close()
} else
throw Error("Download failed",, url)
}
Code: Select all
DownloadURL("https://www.autohotkey.com/download/2.1/AutoHotkey_2.1-alpha.12_setup.exe")
ExitApp
DownloadURL(url, filename?) {
local f, req := ComObject("Msxml2.XMLHTTP")
req.open("GET", url, true)
req.send()
while req.readyState != 4
Sleep 100
if req.status == 200 {
f := FileOpen(filename ?? StrSplit(url, "/")[-1], "w")
f.RawWrite(NumGet(req.responseBody.ptr + 8 + A_PtrSize, "ptr"), req.responseBody.MaxIndex()+1)
f.Close()
} else
throw Error("Download failed",, url)
}
Re: Error trying to download the V1 and V2 files with current version number
That error means "The server is requesting client authentication." as in "give me a certificate that proves your identity". Apparently, if the server does not require authentication but requests it, you must send the request again with the same handles to "authenticate" anonymously.
Re: Error trying to download the V1 and V2 files with current version number
For reference: https://learn.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-interneterrordlg#parameters
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Error trying to download the V1 and V2 files with current version number
@lexikos can confirm, changing script_autoit.cpp from
to
fixes the issue.
Code: Select all
// Open the required URL
HINTERNET hFile = InternetOpenUrl(hInet, aURL, NULL, 0, flags_for_open_url, 0);
if (!hFile)
{
DWORD last_error = GetLastError(); // Save this before calling InternetCloseHandle, otherwise it is set to 0.
InternetCloseHandle(hInet);
return FR_E_WIN32(last_error);
}
Code: Select all
// Open the required URL
HINTERNET hFile = InternetOpenUrl(hInet, aURL, NULL, 0, flags_for_open_url, 0);
if (!hFile)
{
hFile = InternetOpenUrl(hInet, aURL, NULL, 0, flags_for_open_url, 0);
if (!hFile)
{
DWORD last_error = GetLastError(); // Save this before calling InternetCloseHandle, otherwise it is set to 0.
InternetCloseHandle(hInet);
return FR_E_WIN32(last_error);
}
}
Re: Error trying to download the V1 and V2 files with current version number
Thanks for figuring this out @Descolada
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
- JoeWinograd
- Posts: 2214
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Error trying to download the V1 and V2 files with current version number
Hi @Descolada,
I can't speak to your fix of changing script_autoit.cpp, but I can say that your three scripts (version number without downloading a file, download variant 1, download variant 2) all work perfectly! Thank you very much for writing and posting them...I really appreciate it! Regards, Joe
I can't speak to your fix of changing script_autoit.cpp, but I can say that your three scripts (version number without downloading a file, download variant 1, download variant 2) all work perfectly! Thank you very much for writing and posting them...I really appreciate it! Regards, Joe
Re: Error trying to download the V1 and V2 files with current version number
@Descolada When I tested yesterday, both the first and second call returned error 12044. Today it works.
Re: Error trying to download the V1 and V2 files with current version number
v2.0.16 implements the workaround for ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED.
Re: Error trying to download the V1 and V2 files with current version number
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Error trying to download the V1 and V2 files with current version number
Now it doesn't work again, fails with error 12044. Weird...
EDIT: and it started working again. It failed in 2.0.16, then I installed 2.1-alpha.13 and it suddenly started working. I uninstalled 2.1-alpha.13 and went back to 2.0.16, it continued working (even after rebooting). I'm guessing there is some kind of issue remaining, but I have no clue what may be causing it.
Who is online
Users browsing this forum: No registered users and 25 guests