Upcoming Ahk2Exe Changes (2024)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

Post by JoeWinograd » 10 Jul 2020, 13:49

TAC109 wrote:This version is now included in the official AutoHotkey release (version 1.1.33.00).
Hi TAC,

First, both thanks and congratulations on your hard work on this superb enhancement, and for getting it included in the official AutoHotkey release. Thanks, also, to lexikos, joedf, and everyone else who had a hand in making this happen.

Until your previous post, I didn't realize that it was included in v1.1.33.00, so I did the usual of copying the Beta (9f), which worked fine. After your post, I removed the Beta and used the released Ahk2Exe...also worked perfectly!

It then occurred to me that I hadn't updated BinMod in quite a while, so I just did that...went to the 2020.06.20 version...also worked perfectly!

Thanks again for your hard work and for sharing! Regards, Joe
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

Post by TAC109 » 10 Jul 2020, 18:58

Thanks @JoeWinograd. On looking back, I see that it has taken just over a year!
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
User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

Post by JoeWinograd » 10 Jul 2020, 19:05

Time flies...whether or not you're having fun. :)
pv007
Posts: 93
Joined: 20 Jul 2020, 23:50

Re: Upcoming Ahk2Exe Changes (2019)

Post by pv007 » 21 Jul 2020, 16:41

@TAC109 how do i change icons of paused,etc and not just default exe icon using ahk2exe?
User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

Post by JoeWinograd » 21 Jul 2020, 17:20

pv007 wrote:how do i change icons of paused,etc
Hi pv,

In case TAC is out-of-pocket now, here's the answer for you. The other four icons are as follows:

160: red H on white background
206: white S on green background
207: white H on red background (this is Paused)
208: white S on red background

Using TAC's compiler (which is now standard as of version 1.1.33.00), you would put this in your source code for those four icons:

;@Ahk2Exe-AddResource RedHonWhite.ico,160
;@Ahk2Exe-AddResource WhiteSonGreen.ico,206
;@Ahk2Exe-AddResource WhiteHonRed.ico,207
;@Ahk2Exe-AddResource WhiteSonRed.ico,208

Works a charm! Regards, Joe
pv007
Posts: 93
Joined: 20 Jul 2020, 23:50

Re: Upcoming Ahk2Exe Changes (2019)

Post by pv007 » 21 Jul 2020, 17:44

@JoeWinograd hello, where in the source code should I add ? i don't understand it well, its suppose to me comment something? or add those lines somewhere inside the code with my icons name?
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

Post by TAC109 » 21 Jul 2020, 17:50

@pv007
I’ve answered this in your post in the 'Ask for help' section.
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
User avatar
JoeWinograd
Posts: 2166
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

Post by JoeWinograd » 21 Jul 2020, 18:25

pv007 wrote:where in the source code should I add?
I put them towards the top of my script, but note in the documentation that position matters for some of the directives.
pv007 wrote:its suppose to me comment something?
Yes, the directives are comments in your AHK source code.
pv007 wrote:add those lines somewhere inside the code with my icons name?
Yes, add those lines (comments) inside your code, where each AddResource line has the file name (I always use the full path) of the icon as the first parameter (such as c:\MyScripts\HelloWorldPaused.ico) and the appropriate number as the second parameter (such as 207).

Regards, Joe
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

Post by TAC109 » 28 Jul 2020, 18:49

lexikos wrote:
19 Jun 2020, 05:22
I took the liberty of replacing /inGui with /gui, so that I can release v1.1.33. I can't see any logical reason for /in and /gui to be combined.

While I was at it, I cleaned up the command line processing and fixed a couple of related bugs.


(Edit: The v1.1.33 release is being delayed by an issue with my latest code signing certificate.)
@lexikos I see that the final step of adding the Compile script (GUI) (or similar) context menu registry item didn’t make it into the AutoHotkey installer. (There was discussion on this in earlier posts in this thread.) Was there a reason for this omission?
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
lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

Post by lexikos » 28 Jul 2020, 21:36

No reason. I must have forgotten.
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

Post by TAC109 » 28 Jul 2020, 22:25

@lexikos May I help in any way for the next release?
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
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2020)

Post by TAC109 » 05 Sep 2020, 21:56

1.1.33.03_Beta_1, 6 September 2020 -
  • Adds parameters to the PostExec directive.
  • Stops Auto-Includes being executed directly by fall-through.
  • Uses installation 'Default to UTF-8' setting.
  • Allows multiple Bin directive Codepage parameters.
  • Sets default V2 script encoding to UTF-8.
  • Stops confusing error message when /exe path has '/' instead of '\'.
  • Warning messages now include 'Press OK to continue, Cancel to abandon' advice.
  • Uses correct AutoHotkey*.exe for V2 compiles.
See this post for download details.
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
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe Changes (2020)

Post by haichen » 06 Sep 2020, 06:40

Stops Auto-Includes being executed directly by fall-through.
Could you please explain this. Unfortunately I have no idea what this is all about.
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2020)

Post by TAC109 » 06 Sep 2020, 18:53

@haichen
See this thread for background information.
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
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe Changes (2020)

Post by haichen » 07 Sep 2020, 03:23

Thanks for the link.
With it the hint became understandable for me.
User avatar
Endor 7
Posts: 4
Joined: 15 Nov 2020, 17:54

Re: Upcoming Ahk2Exe Changes (2020)

Post by Endor 7 » 15 Nov 2020, 18:42

Could it be possible to improve the FileInstall command so it is able to search for files within library folders?

I believe this could make easier to share and distribute libraries that require certain resources (such as DLLs or images), while avoiding the need to copy said resources to a specific location before compiling a script that uses such libraries. The resources could be stored besides the library, within library folders, and scripts would be able to use them either directly from library folders when uncompiled, or FileInstall them once to a reusable folder when compiled (such as A_AppData . "\AutoHotkey\LibraryName\").
Perhaps a syntax matching the #Include directive could be used, where FileInstall <Dependency.dll>, ... would mean to search for the file Dependency.dll within library folders at compile time.

Currently this is not possible to do at all for the user library folder, nor for the standard library without assuming AHK's installation path. It's also not possible to try to FileInstall a dependency from various locations, since compilation will quickly fail on the first file not found (I'm not trying to say this should be possible), so I can't think of any workaround besides actually improving the command. Perhaps I'm missing something...?

I'm sorry if this is not the best place for a feature request. ^^'
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2020)

Post by TAC109 » 15 Nov 2020, 20:22

As your enhancement request would affect AutoHotkey.exe as well as Ahk2Exe you would be best to post this in the Wish List section of the forum.
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
User avatar
Endor 7
Posts: 4
Joined: 15 Nov 2020, 17:54

Re: Upcoming Ahk2Exe Changes (2020)

Post by Endor 7 » 16 Nov 2020, 05:29

Thank you!
I just did so here

Update: I came up with a workaround using compiler directives described in the same topic.
Thanks for making this possible, TAC109 ^^
TAC109
Posts: 1096
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2021)

Post by TAC109 » 25 Jan 2021, 18:50

1.1.33.03_Beta_2, 26 January 2021 -
  • Clarifies an anti-virus warning message.
  • Fixes a possible spurious '#Warn Unreachable' message.
See this post for download details.
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
lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe Changes (2021)

Post by lexikos » 23 Mar 2021, 03:09

@TAC109
Directive_Obey uses v1 syntax in the boilerplate code it generates to evaluate the expression, but then uses %ahkpath% to run the script. If you are compiling a v2 script, %ahkpath% must be a v2 exe, otherwise it will report syntax errors in the script being compiled. But if %ahkpath% is a v2 exe, it can't run the "obey" code.

For example,

Code: Select all

;@Ahk2Exe-Obey U_test, = expression
generates

Code: Select all

U_test:= expression
FileAppend % U_test,...\Temp\~Ahk2Exe~AutoHotkey~Obey~7930048968519.tmp0
#NoEnv
I suppose it could generate this instead:

Code: Select all

FileOpen("...\Temp\~Ahk2Exe~AutoHotkey~Obey~7930048968519.tmp0", "w").Write(expression)
Omitting #NoEnv seems unlikely to be a problem for v1 in this context, but if you think it's necessary, you can check the version of %ahkpath% before writing the code. The directive does not exist in v2.
Post Reply

Return to “Scripts and Functions (v1)”