Page 7 of 32

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 16 Sep 2019, 23:46
by hoppfrosch
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?

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 00:29
by TAC109
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.

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 01:34
by hoppfrosch
@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:

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 02:56
by haichen
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. :)

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 03:48
by Drugwash
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...

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 04:45
by TAC109
@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!

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 08:35
by joedf
I dont have a kitten :(
Get well soon @Drugwash !

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 14:39
by Drugwash
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. :(

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 15:47
by TAC109
@Drugwash So sad! Thinking of you. Take care.

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 17 Sep 2019, 17:28
by TAC109

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 18 Sep 2019, 07:24
by Drugwash
Thank you so much, you're very kind.

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 19 Sep 2019, 10:46
by joedf
Okay, I will start bringing in the changes from TAC109/Ahk2Exe to AutoHotkey/Ahk2Exe tomorrow tonight. :+1:

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 19 Sep 2019, 21:50
by TAC109
@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!

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 20 Sep 2019, 14:29
by joedf
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

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 28 Sep 2019, 12:31
by JoeWinograd
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

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 28 Sep 2019, 16:56
by TAC109
@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

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 28 Sep 2019, 18:05
by JoeWinograd
Thanks, TAC. I just tested your 1.1.30.03_beta_5 with v1.1.31.00 — worked perfectly! Great job! Regards, Joe

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 28 Sep 2019, 22:23
by TAC109
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.

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 28 Sep 2019, 22:41
by TAC109
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.

Re: Upcoming Ahk2Exe Changes (2019)

Posted: 29 Sep 2019, 02:42
by JoeWinograd
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