Could you let me have the failing uncompressed .exe? You can PM me a link (or whatever you think is best).
Ta
Upcoming Ahk2Exe Changes (2024)
Re: Upcoming Ahk2Exe Changes (2019)
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
Re: Upcoming Ahk2Exe Changes (2019)
Before you do that, could you find which fileinstall(s) are causing the trouble?
Edit: Also, could you compile the full failing code with the ;@Ahk2Exe-PostExec BinMod lines removed/commented out?
Cheers
Edit: Also, could you compile the full failing code with the ;@Ahk2Exe-PostExec BinMod lines removed/commented out?
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
The script is around 1,000 lines, but I was able to reproduce the problem in a test script of fewer than 30 lines. I'll PM you a link to both the source and EXE.
While I was writing the above, your second post came in. I'll try to figure out which of the four is causing the problem. Regards, Joe
Edit: Didn't see your edit until after posting. Will try removing the BinMod first.
While I was writing the above, your second post came in. I'll try to figure out which of the four is causing the problem. Regards, Joe
Edit: Didn't see your edit until after posting. Will try removing the BinMod first.
- JoeWinograd
- Posts: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Ah, good call! It works fine with the BinMod removed. What does that tell you?
Re: Upcoming Ahk2Exe Changes (2019)
Right!
Not fully clear at this stage. Could you PM me the test sources and .exe? Ta
Not fully clear at this stage. Could you PM me the test sources and .exe? Ta
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Will do. I'll try to narrow it down to a single FileInstall.
- JoeWinograd
- Posts: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Very interesting results:
(1) With a single FileInstall, I do not get the "Could not extract script from EXE" dialog, but the installed file is 0 bytes, so the FileInstall does not work. This is true for all four file types (ICO, INI, PDF, TXT).
(2) With two FileInstall commands, I get the "Could not extract script from EXE" dialog.
Here are a few lines that create the problem...I'm confident you'll get it there, but if not, let me know:
It's past 3am here and this is my last post for the night. Will check back into the thread first thing in my morning. Regards, Joe
(1) With a single FileInstall, I do not get the "Could not extract script from EXE" dialog, but the installed file is 0 bytes, so the FileInstall does not work. This is true for all four file types (ICO, INI, PDF, TXT).
(2) With two FileInstall commands, I get the "Could not extract script from EXE" dialog.
Here are a few lines that create the problem...I'm confident you'll get it there, but if not, let me know:
Code: Select all
; IMPORTANT: strlen of replacement must be 19 (strlen of >AUTOHOTKEY SCRIPT<) - pad with blanks if needed - and must be all upper case
;@Ahk2Exe-PostExec "c:\temp\BinMod.exe" "%A_WorkFileName%" "22.>AUTOHOTKEY SCRIPT<.THISISCOMPANY LLC "
FileInstall,c:\temp\test.ini,%A_ScriptDir%\test.ini,1 ; overwrite
FileInstall,c:\temp\test.txt,%A_ScriptDir%\test.txt,1 ; overwrite
MsgBox Ahk2Exe FileInstall test done
Re: Upcoming Ahk2Exe Changes (2019)
Earlier you wrote:
>Edit: Btw, without MPRESS, ResourceHacker shows the script, the INI file, and the TXT file perfectly.
Now they are not ok?
It’s probably best if you send me a link to the test source files and the failed compiled .exe and I can dig into the problem here.
Also a link to the original full failed uncompressed .exe would be helpful.
Cheers
>Edit: Btw, without MPRESS, ResourceHacker shows the script, the INI file, and the TXT file perfectly.
Now they are not ok?
It’s probably best if you send me a link to the test source files and the failed compiled .exe and I can dig into the problem here.
Also a link to the original full failed uncompressed .exe would be helpful.
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
They're still OK, i.e., without MPRESS, ResourceHacker shows the script, the INI file, and the TXT file perfectly. Here are those three files:Now they are not ok?
Script:
Code: Select all
; IMPORTANT: strlen of replacement must be 19 (strlen of >AUTOHOTKEY SCRIPT<) - pad with blanks if needed - and must be all upper case
;@Ahk2Exe-PostExec "c:\temp\BinMod.exe" "%A_WorkFileName%" "22.>AUTOHOTKEY SCRIPT<.THISISCOMPANY LLC "
FileInstall,c:\temp\test.ini,%A_ScriptDir%\test.ini,1 ; overwrite
FileInstall,c:\temp\test.txt,%A_ScriptDir%\test.txt,1 ; overwrite
MsgBox Ahk2Exe FileInstall test done
Code: Select all
test ini file
Code: Select all
test txt file
The test source files are above...a five-line script, a one-line INI file, a one-line TXT file (I suspect that any two FileInstall files will create the problem).It’s probably best if you send me a link to the test source files and the failed compiled .exe and I can dig into the problem here.
Here's the error dialog when running the EXE:
Here's the ResourceHacker view of RCData:
Here's the ResourceHacker view of the script:
The ResourceHacker view of the INI file and TXT shows the one line in each fine.
I'll PM that to you, but I'll be very surprised if you can't reproduce the problem there, unless we have different BinMod executables, since we determined that the problem goes away when the BinMod PostExec directive is removed. I'll include a link in the PM to my BinMod.exe. Regards, JoeAlso a link to the original full failed uncompressed .exe would be helpful.
Re: Upcoming Ahk2Exe Changes (2019)
@JoeWinograd Hi Joe. Hope you slept well.
I've found the problem!
Windows apparently expects to find the resources in RCData in alphabetical order, and arranges them this way when creating the .exe. So the script resource >AUTOHOTKEY SCRIPT< appears first. When BinMod changes this name to "THISISCOMPANY LLC ", this entry becomes out of order and the .exe interpreter can't find the script. (For some reason this problem only crops up when there is more than one FileInstall.)
The simple solution would be to prefix the replacement name with (space). I've checked this works with the test data you supplied. I'll add a comment to the BinMod.ahk script on GitHub.
Can you let me know if this solves the original problem?
Cheers
I've found the problem!
Windows apparently expects to find the resources in RCData in alphabetical order, and arranges them this way when creating the .exe. So the script resource >AUTOHOTKEY SCRIPT< appears first. When BinMod changes this name to "THISISCOMPANY LLC ", this entry becomes out of order and the .exe interpreter can't find the script. (For some reason this problem only crops up when there is more than one FileInstall.)
The simple solution would be to prefix the replacement name with (space). I've checked this works with the test data you supplied. I'll add a comment to the BinMod.ahk script on GitHub.
Can you let me know if this solves the original problem?
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Fascinating problem! Yes, the fix works perfectly on the 1,000-line script with the four FileInstall commands. I had been padding the end with two spaces to make the 19 characters, so I simply changed it to one space at the beginning and one space at the end...works a charm! Thanks for your efforts in tracking down the problem and providing a simple work-around...very much appreciated! Regards, Joe
Re: Upcoming Ahk2Exe Changes (2019)
I have a hypothesis as to why it worked with just 1 FileInstall, and that is that Windows uses a binary chop method to find the resource it is looking for. With 3 items it would start by looking at item 2 and deciding that it needs to look further down the list - and not find the script. With 2 items it would start by looking at item 1 and find the script immediately.
Regards
Regards
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
Well, keep in mind that it "worked" only to the extent that it did not display the "Could not extract script from EXE" dialog. But the FileInstall does not really work, as the installed file is always 0 bytes. Cheers, Joe
Re: Upcoming Ahk2Exe Changes (2019)
Joe, the same hypothesis would explain that anomaly as well.
BTW, thanks for the clear evidence you provided. I was able to study your screen shots, then go out for a walk. While walking a couple of likely scenarios occurred to me and, luckily, the last one was correct!
Cheers
BTW, thanks for the clear evidence you provided. I was able to study your screen shots, then go out for a walk. While walking a couple of likely scenarios occurred to me and, luckily, the last one was correct!
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: 2203
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Upcoming Ahk2Exe Changes (2019)
> the same hypothesis would explain that anomaly as well
Got it.
> thanks for the clear evidence you provided
You're welcome...glad I could help.
> luckily, the last one was correct!
Nothing lucky about it. Cheers, Joe
Got it.
> thanks for the clear evidence you provided
You're welcome...glad I could help.
> luckily, the last one was correct!
Nothing lucky about it. Cheers, Joe
Re: Upcoming Ahk2Exe Changes (2019)
does this particular version of Ahk2Exe happen to work with compiling AutoHotkey_H scripts with the proper .bin files? Or is AutoHotkey_H compiler a different project?
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: Upcoming Ahk2Exe Changes (2019)
No, this version of Ahk2Exe just handles the standard versions (v1 and v2). For AutoHotkey_H compiles you need to use the Ahk2Exe included with AutoHotkey_H.
Edit: Although AutoHotkey_H's Ahk2Exe includes some of the Compiler Directives that are in the beta version here.
Cheers
Edit: Although AutoHotkey_H's Ahk2Exe includes some of the Compiler Directives that are in the beta version here.
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
Re: Upcoming Ahk2Exe Changes (2019)
New version available -
Beta_9a 01 May 2020 -
Beta_9a 01 May 2020 -
- Allows retrying from the error "Error opening the destination file" - This can be caused by automatic anti-virus checking.
- Remembers previous script and icon folders in repeated GUI use.
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
Re: Upcoming Ahk2Exe Changes (2019)
New version available -
Beta_9b 30 May 2020 -
Beta_9b 30 May 2020 -
- Fixed 'busy cursor' not shown while .exe being moved to final destination.
- Add option to show GUI from context menu - see updated documentation.
- (Use the included .reg file to create a 'Compile Script (GUI)' context menu shortcut - requires admin privilege to setup.)
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
Re: Upcoming Ahk2Exe Changes (2019)
New version available:
Beta_9c 10 June 2020 -
Beta_9c 10 June 2020 -
- Fixed /inGui parameter so that the Gui is not closed after a compile error.
- Updated help to use the AutoHotkey 'house style' (thanks Ragnar_F).
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
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 65 guests