Page 1 of 1

Compressing autohotkey.exe before compiling script causes memory error

Posted: 08 Sep 2017, 05:30
by hobboy
When compiling AHK scripts I've found that I receive a memory error if I compress AutoHotkey.exe before I compile (e.g. "The application was unable to start correctly (0xc0000005)").

This is the process:
1) build/compile AHK_H
2) compress AutoHotkey.exe with upx.exe (part of the build step in Visual Studio, or do this separately)
3) compile myscript.ahk using AutoHotkey.exe => myscript.exe
Running a script works fine with the compressed AutoHotkey.exe e.g.

Code: [Select all] [Download] GeSHi © Codebox Plus

AutoHotkey.exe myscript.ahk

However, compiling the script with AutoHotkey.exe fails, e.g. running myscript.exe

If we compress after compiling the script it's fine:
1) build/compile AHK_H
2) compile myscript.ahk using AutoHotkey.exe => myscript.exe
3) compress myscript.exe with upx

Is there a layman explanation for why I shouldn't compress AutoHotkey.exe before using it to compile scripts? I find it a bit unusual since the Visual Studio project specifically has a macro to compress AutoHotkey.exe in the build process. Perhaps it's an issue with upx?

Re: Compressing autohotkey.exe before compiling script causes memory error

Posted: 10 Sep 2017, 04:29
by HotKeyIt
I am not sure what is causing this issue. I will have to debug and see what is going on.