Upcoming Ahk2Exe Changes (2024)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

16 Sep 2019, 23:46

TAC109 wrote:
16 Sep 2019, 18:48
Ahk2exe should be installed as stated in the first post of this topic, i.e. the Compiler sub-directory under where AutoHotkey has been installed. (Usually C:\Program Files\AutoHotkey\Compiler\.).
It's a real pity, that Ahk2exe requires a fixed structure / a real installation of AutoHotkey (including Registry entries).
I've had planned to provide (within the company I work for) some compiled AHK-scripts via our deployment systems (using a VirtualMachine via Jenkins to do the compilation process and to build the releases/exes). As the VirtualMachines should not be permanently manipulated,our policy does not allow to install Autohotkey there (creating registry settings). I hoped the directory structure I mentioned above would allow me to bring the "complete" AHK-environment (including AutoHotkey itself, the Compiler and my script with all it's dependencies) to the VirtualMachine temporarily, compile the script and remove the whole environment without leaving any traces. Having the current situation (with the need of an installed AutohotHotkey) I currently don't know how to compile on a "naked" machine without a real installation of AutoHotkey, which would violate our policies.
Side remark - even if I would be allowed to install AutoHotkey: since my build may run on one of many build agents, I do not wish to maintain a suite of preinstalled software like AutoHotkey on multiple agents.

Any ideas?
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 00:29

You don’t need an installed AutoHotkey. If you amend your folder structure like below (as an example) you should be fine.

Code: Select all

|--\somewhere
   |--Autohotkey.exe      <--- Main AutoHotkey executable
|--\project
   |--\bin
       |--autohotkey.exe    <--- This will be used by Ahk2Exe.exe 
       |—\Compiler
           |--Ahk2Exe.exe     
           |--AutoHotkeySC.bin    <--- This should be used with Ahk2Exe.exe
   |--\src
Another way (you have 2 AutoHotkey.exe's in your structure):

Code: Select all

|--\somewhere
   |--Autohotkey.exe      <--- Main AutoHotkey executable (will be used by Ahk2Exe)
   |—\compiler
       |— ahk2exe.exe
|--\project
   |--\Bin
       |--AutoHotkeySC.bin   
   |--\src
Hope this helps.

Edit: I see there was some confusion with the 'install' term I used. Here I meant like in the phrase 'how to install' rather than 'installing using the official installer'.

Also the 'Compiler' folder I show in the structure can be called anything you like. It’s the structure that’s important.
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
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 01:34

@tac109: Thx for the hints! You're right: there has been confusion about what means "install" ...
I just changed my folder structure according your first suggestion - and now it looks as it works as I expected. Will have to test more thoroughly, but yet it looks fine! :dance:
User avatar
haichen
Posts: 631
Joined: 09 Feb 2014, 08:24

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 02:56

Did you maybe switch the code blocks "Another way (you have 2 AutoHotkey.exe's in your structure):.." ?

Am I seeing the first structure right? If there was a directive for the path to Ahk2exe, you could also switch between AHK V1 and V2? If so, it would be nice to have one. :)
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 03:48

joedf wrote:
16 Sep 2019, 13:30
Interesting, I like the idea of specifying. I think this would be better suited as a directive and/or command-line option of some kind.
We don't want to add too much to the GUI. It has to remain relatively simple for newer users, even I was confused, at first, as to what compiling meant for ahk and what the options were...
As a rule, it would be best to match in-script directives, command line options and GUI options. Otherwise we would force users to only use one or the other, meaning lack of flexibility. And some people will complain.

As for the GUI, the options are already strictly delimited: Required and Optional. So users shouldn't be so much confused if they simply want their script compiled without any additional tweaks. In time they'll learn about the optionals and how to use them correctly.
At the very beginning I, for one, was happy to have the output name and icon fields available, as well as the compression option (less space on HDD, less upload traffic on my metered connection, less time spent uploading - considering old Win98SE system I was using).
TAC109 wrote:
17 Sep 2019, 00:29
If you amend your folder structure like below (as an example) you should be fine.
Personally I'd add (in all three places: directives, command line, GUI) the ability to select a custom exe (with its own Lib folder) which would be used for all internal operations, this allowing to have a single Ahk2Exe located anywhere in the system, if the user so desires, without the hassle of having to switch between N compilers when there are N scripts to compile, plus avoiding another possible hassle of having to update N copies of the compiler if/when Ahk2Exe gets updated. And of course it wouldn't force the user to build a fixed folder structure that may not match their habits or whatever.
Added bonus: the script settings saved by the user, if any, could be executed from anywhere without having to change anything in those scripts.

Anyway, that's just how I'd do it, and I would - if only offline, for personal use - if I didnt have to care for the four sick kittens plus the one with broken leg and hernia operated yesterday. But maybe I will, one-two code lines a day...
Part of my AHK work can be found here.
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 04:45

@hoppfrosch
Pleased it is sorted for you. :D

@haichen
> .. new directive ...
It’s a thought!
(At present I’m waiting for my failed computer to be replaced. It should be here in a few days.)

@Drugwash
All the best for your kittens :angel:. We have a cat too!
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
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 08:35

I dont have a kitten :(
Get well soon @Drugwash !
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 14:39

Unfortunately the smallest girl died this evening. One of her sisters died about a week ago. They were only two months old. Dunno what's going on, could be a virus. Another older girl had an ear infection and remained with a lack of balance, possibly something worse - she can't even walk straight, let alone jump and climb on things. Won't go into details about others, it hurts too much. My "kids" are as unlucky as myself. :(
Part of my AHK work can be found here.
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 15:47

@Drugwash So sad! Thinking of you. Take care.
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: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

17 Sep 2019, 17:28

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
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

18 Sep 2019, 07:24

Thank you so much, you're very kind.
Part of my AHK work can be found here.
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

19 Sep 2019, 10:46

Okay, I will start bringing in the changes from TAC109/Ahk2Exe to AutoHotkey/Ahk2Exe tomorrow tonight. :+1:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

19 Sep 2019, 21:50

@joedf
Thanks. Although it is a marginal case, I think I’ll add specifying the location of AutoHotkey.exe to the Directives and also as a parameter to the CLI. I’ll look at this in the next day or two. 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
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

20 Sep 2019, 14:29

Sounds good! I wait for that then, no rush :+1:
The rebase had some issues last time, so auto-merge doesnt work. I'd rather do it all in one shot :p
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
User avatar
JoeWinograd
Posts: 2177
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

28 Sep 2019, 12:31

Hi TAC109,
Two things for you. First, a belated thanks for adding the "LegalTrademarks" property and the UPX compression option on 8-Jun...very much appreciated! Second, is the current beta version compatible with the recent release of 1.1.31.00? Thanks again, Joe
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

28 Sep 2019, 16:56

@JoeWinograd
I don’t anticipate a problem using this beta version of Ahk2Exe with 1.1.31.00 or any future version of AHK. (I’m in the middle of adding a small enhancement to Ahk2Exe so I don’t want to update my version of AutoHotkey right now.)
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
JoeWinograd
Posts: 2177
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

28 Sep 2019, 18:05

Thanks, TAC. I just tested your 1.1.30.03_beta_5 with v1.1.31.00 — worked perfectly! Great job! Regards, Joe
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

28 Sep 2019, 22:23

New version available:-

Beta_6, 29 September 2019 -
  • Implement the CLI /ahk parameter to specify the path\name of AutoHotkey.exe if non-standard.
    (Used during the compilation process.)
  • Fixed bug when the path to AutoHotkey.exe contains spaces.
  • Fixed to allow concurrent compiles to work better.
Last edited by TAC109 on 07 Oct 2019, 16:49, edited 1 time in total.
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: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

28 Sep 2019, 22:41

I had a long think about adding the equivalent of the CLI /ahk parameter to the directives, but in the end I decided not to. Adding this directive would have been too confusing for the target user of these facilities, and would have been of marginal use at best. So finally I decided to just add the new parameter (/ahk) to the Ahk2Exe command, where it will be available if needed.
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: 2177
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

29 Sep 2019, 02:42

Hi TAC,
Tested your Beta_6 on v1.1.31.00 with these directives:

;@Ahk2Exe-SetName
;@Ahk2Exe-SetDescription
;@Ahk2Exe-SetVersion
;@Ahk2Exe-SetOrigFilename
;@Ahk2Exe-SetCompanyName
;@Ahk2Exe-SetCopyright
;@Ahk2Exe-SetLegalTrademarks

Worked perfectly! Btw, the Title bar says Ahk2Exe for v1.1.30.03_Beta_6. Regards, Joe

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 94 guests