Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Upcoming Ahk2Exe changes

  • This topic is locked This topic is locked
78 replies to this topic
Daniel Beardsmore
  • Members
  • 3 posts
  • Last active: Jul 20 2016 08:03 PM
  • Joined: 06 Dec 2013

I've found what appears to be a strange bug. I've got a script which runs:


SetWorkingDir %A_ScriptDir%


RunWait, "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "My main script.ahk" /out "MyExecutable.exe" /icon "My icon.ico" /bin "C:\Program Files\AutoHotkey\Compiler\Unicode 32-bit.bin" /mpress 1, , UseErrorLevel


The source code is on a UNC share. mpress is seeing share violations on the EXE.


I cannot reproduce this if I copy the whole directory to my local hard drive.


I cannot reproduce this if I use the release build of the compiler (i.e. swap the two EXEs in the Compiler directory).


The most that I can determine from Process Monitor is as follows:


1. mpress copies the EXE to a temp file

2. mpress hits a sharing violation on the target (EXE) file (three retries) presumably when writing out the compressed EXE


mpress.exe (2.19) does not return a status code under these circumstances, so ahk2exe is not being made aware of the problem. (I have tested this by using /mpress 0 and running mpress manually as a separate step).


By and large I'm having more luck running mpress manually after ahk2exe completes — typically this works OK. Not always, but usually.


This is on my XP computer. I can't reproduce this under Windows 7.


Not a huge issue, I just need to double-check that compression actually worked each time :)


There's some very weird juju with ahk2exe/mpress and some horrible timing sensitivities.


ahk2exe status code


ahk2exe.exe does not appear to return a status code if compile fails. (I'm also getting occasional "Error: Unable to copy AutoHotkeySC binary file to destination." and my script cannot pick up on this, and tries to run the compress stage, as there's no errorlevel output from this. I can't say off-hand exactly what the message is as it won't do it now.)

  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012

i agree on the ahk2exe status code. it should have stderr+exit code

Why ahkscript.org? - autohotkey.com is outdated

Daniel Beardsmore
  • Members
  • 3 posts
  • Last active: Jul 20 2016 08:03 PM
  • Joined: 06 Dec 2013

For now I've worked around all the problems so I'm happy.

  • Members
  • 245 posts
  • Last active: Mar 12 2015 02:29 PM
  • Joined: 06 Apr 2012

It would be nice to have ;@Ahk2Exe-SetClassName  :D For example:

;@Ahk2Exe-SetClassName MyGUI

Although I already knew the way to do this, by reading this post.