TL;DR: "new" AHK versions broke LIB folder inclusion when script is compiled but not when running it in script form?
I've been a user of AHK for long years, but recently faced an issue.
I've been using an AHK_L version from back 2015 (1.1.20.01), so I decided to update it to current latest.
Did so, and noticed that recompiling one of my scripts (that I've been running from maybe 8+ years) broke it.
However it runs fine in AHK form. (both using the ANSI executable, Win7)
The script does a lot of things, but the issue seems to be around the following code:
Code: Select all
if (A_Is64Bit())
{
WinRAR_PATH := RegRead64("HKEY_LOCAL_MACHINE", "SOFTWARE\WinRAR", "exe64")
} else {
RegRead, WinRAR_PATH, HKEY_LOCAL_MACHINE, SOFTWARE\WinRAR, exe32
}
I've added them to the attachments for reference (in case it makes a difference).
I have both of them in the lib folder of AHK (as always):
"C:\Program Files\AutoHotkey\Lib"
Also in my script I'm not playing with any form of #include directive...
The script is failing with the following message:
Again, it was working fine with AHK_L before, and also works fine with the script in ahk.---------------------------
my_script.exe
---------------------------
Error: Call to nonexistent function.
Specifically: A_Is64Bit())
Line#
---> 025: if (A_Is64Bit())
The program will exit.
---------------------------
OK
---------------------------
It only fails when compiled.
I'm using SciTE4AutoHotkey to compile where the compilation command it is running is:
"C:\Program Files\AutoHotkey\SciTE\..\Compiler\Ahk2Exe.exe" /in "D:\Dropbox\AHK\my_script.ahk" /bin "C:\Program Files\AutoHotkey\SciTE\..\Compiler\ANSI 32-bit.bin"
Is this something that changed recently or is known to be an issue? (I couldn't find anything in the 10 mins or so I searched this forum)
[update]
I had a copy of the autohotkey folder before installing the new version, and managed to find that if I revert the "C:\Program Files\AutoHotkey\AutoHotkey.exe" back to the 2015 version and recompile the script, it runs again sucessfully...
Now, that sounds weird as I wouldn't expect the main executable to affect the script compilation (I thought ahk2exe would be independent from the main exe one).
Something changed for sure... maybe I need to do new actions in my script to be compliant with the new AHK versions?