;@Ahk2Exe-Base Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

;@Ahk2Exe-Base

Post by JBensimon » 02 Jul 2022, 09:58

BinBase.png
BinBase.png (13.42 KiB) Viewed 765 times
Am I reading correctly that the AutoHotkey interpreters (*.exe) themselves can be used instead of the provided *.bin files to create compiled scripts?? If so, will Ahk2Exe.exe automatically look for them in its folder's parent or must a full path to the .exe(s) always be provided?

Let me use this opportunity to congratulate and thank :bravo: all those who worked on the improved compiler and the embedded compiler directives: it was a major addition to AHK! (... even before I discovered today the ;@Ahk2Exe-UpdateManifest ..., UIAccess directive, saving me the hassle of ResHacking copies of the .bin files for UIAccess every time a new release dropped! :facepalm:)

JB

JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: ;@Ahk2Exe-Base  Topic is solved

Post by JBensimon » 02 Jul 2022, 11:59

To answer my own questions:
JBensimon wrote:
02 Jul 2022, 09:58
[...] the AutoHotkey interpreters (*.exe) themselves can be used instead of the provided *.bin files to create compiled scripts??
Yes. The resulting executables are somewhat larger than if the .bin files were used, but they work.
JBensimon wrote:
02 Jul 2022, 09:58
[...] will Ahk2Exe.exe automatically look for them in its folder's parent?
No.
JBensimon wrote:
02 Jul 2022, 09:58
[...] or must a full path to the .exe(s) always be provided?
No, it suffices that Ahk2Exe.exe be copied to the same folder as the main AutoHotkey EXEs (along with mpress.exe or upx.exe, if either is specified).

TAC109
Posts: 1111
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: ;@Ahk2Exe-Base

Post by TAC109 » 02 Jul 2022, 20:56

JBensimon wrote:
02 Jul 2022, 11:59
JBensimon wrote:
02 Jul 2022, 09:58
[...] or must a full path to the .exe(s) always be provided?
No, it suffices that Ahk2Exe.exe be copied to the same folder as the main AutoHotkey EXEs (along with mpress.exe or upx.exe, if either is specified).
@JBensimon
This is not the preferred location of the compiler as the Ahk2Exe compiler should only be run from the Compiler directory. You can reference the AutoHotkey executable from the Base directive thus (for example):

Code: Select all

 ;@Ahk2Exe-Base ..\AutoHotkeyU64.exe
The ..\ references the directory up one level from the current (compiler) directory.

Thanks for your kind comments.

Edit: I’ve amended the Base documentation to show that that path can be relative. It will appear when the documentation is next updated.
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

JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: ;@Ahk2Exe-Base

Post by JBensimon » 03 Jul 2022, 13:19

Thanks, TAC109.

As long as I "have" you, maybe you can allay a concern: the ;@Ahk2Exe-Bin directive example in the current documentation is commented as "deprecated". Is it that choice of directive name that is deprecated, or the use of the .bin files for compilation? The latter would be problematic because, if all scripts someday are compiled with the executables, it opens up the possibility of using an organization's trusted compiled script to run arbitrary scripts via the /script switch.

Thank again.

TAC109
Posts: 1111
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: ;@Ahk2Exe-Base

Post by TAC109 » 03 Jul 2022, 17:49

@JBensimon
Both directives can be used with either type of base files (*.bin, *.exe); there is no limitation in this respect. For version 1 of AutoHotkey *.bin files will still be produced into the future as far as I know. (This is controlled by @lexikos.)

When the documentation says that something is depreciated it means that it is preferred that the newer form of the directive is used, however the depreciated version is still supported into the future because of the ongoing philosophy of not breaking old scripts.

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

JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: ;@Ahk2Exe-Base

Post by JBensimon » 04 Jul 2022, 08:04

Thank you yet again.

JB

Post Reply

Return to “Ask for Help (v1)”