Upcoming Ahk2Exe Changes (2024)

Post your working scripts, libraries and tools for AHK v1.1 and older
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

15 Oct 2019, 17:22

@developers
Just looking at updating the help. I’m planing on updating the 'script.htm', Ahk2Exe section, plus linking to a new page with the Directives. Is this the best way to go, or just include the Directives in the script.htm file? (I’m a newbie here.)

Also
  • Editor to use? (I’ve just used Notepad up to now)
  • Is there an easy way to test and view the changes?
TIA
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)

15 Oct 2019, 18:39

TAC109 wrote:
15 Oct 2019, 17:22
@developers
Just looking at updating the help. I’m planing on updating the 'script.htm', Ahk2Exe section, plus linking to a new page with the Directives. Is this the best way to go, or just include the Directives in the script.htm file? (I’m a newbie here.)

Also
  • Editor to use? (I’ve just used Notepad up to now)
  • Is there an easy way to test and view the changes?
TIA
Also, do I need to update indexes, searching info?
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: 9559
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

16 Oct 2019, 03:19

Definitely give the directives their own page.

I use Notepad++ plus hotkeys and hotstrings. Any text editor is fine.

To test and view changes, you should be able to just open the htm file in a browser. If you have the HTML Help compiler, you can also run compile_chm.ahk to build AutoHotkey.chm, and open that.

The search index should be rebuilt automatically by the release script. New pages (or sometimes topics) should be added to the "index" (data_index.js) and table of contents (data_toc.js).
User avatar
Drugwash
Posts: 850
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

16 Oct 2019, 03:56

Speaking about the Help file, please please revert to the old style, or at least provide that as an alternative. Under Linux (Mint 19.x here) the current file won't display anything, it stays on loading forever. :( I've been using the online help a few times but that one is slow and unconfortable.
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)

16 Oct 2019, 09:34

@TAC109 @lexikos
I think maybe we can put the error codes in the documentation somewhere too instead of redirecting users to a link?
https://github.com/AutoHotkey/Ahk2Exe/blob/master/ErrorCodes.md
...but perhaps it doesn't warrant having its own page. Should there be an Ahk2Exe or a "Script Compiling" page?

Thoughts?


@Drugwash
How are you running ahk under linux mint? is it with wine? You could try loading the docs html files from the source zip with javascript disabled?
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)

16 Oct 2019, 19:18

@joedf
I don’t see that putting the error codes into the chm would be useful. They are of limited use anyway, as the first error encountered causes a detailed message box to be shown in all cases, then the conversion is abandoned. Error codes in the chm will also be more difficult to maintain.

If it is required to check scripts for load errors, other methods (such as using AutoHotkey.exe with appropriate switches) are more effective than using Ahk2Exe.

(Edited for clarity)
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)

16 Oct 2019, 20:22

Fair enough :+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)

16 Oct 2019, 20:41

@Drugwash
If you can run Microsoft's HTML Help Workshop you can roll your own.

Here's the instructions I snipped from the 'Wish List' part of the forum:

Code: Select all

@Ragnar Apr 6 2018 'Suggestions on documentation improvements'

If anyone wants the offline help with the old sidebar back, here's what you can do:

1. Download and install [http://go.microsoft.com/fwlink/p/?linkid=14188] Microsoft's HTML Help Workshop,
    if not already done (default location is C:\Program Files (x86)\HTML Help Workshop\).

2. Download the [
https://github.com/Lexikos/AutoHotkey_L-Docs/archive/master.zip - v1.1
https://github.com/Lexikos/AutoHotkey_L-Docs/archive/v2.zip     - v2
] current help files[/url] at GitHub and extract the zip file.

3. Search for compile_chm.ahk, open it in an editor and uncomment the lines after "use old sidebar" (currently line 31). 

4. Run compile_chm.ahk. (Under v1.1 AHK.)

5. Search for the created AutoHotkey.chm in the same location as compile_chm.ahk.

5. Run AutoHotkey.chm (don't forget to check "Navigation Tabs" in the view menu, if it was previously unchecked).
I use it on my Windows computer to create a standard .chm to copy to my iPad for reference purposes.

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
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

16 Oct 2019, 21:14

@lexikos
Thanks.

In the index.js, some of the entries have 1 or 2 extra fields, e.g. '6,"SSSSESSS"'. Are these fields documented anywhere?

In the .htm files, under <head> there are entries <title> <meta name=... content=...> . Are the name and content important? Where are they used?

TIA
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)

17 Oct 2019, 06:30

joedf wrote:
16 Oct 2019, 09:34
How are you running ahk under linux mint? is it with wine? You could try loading the docs html files from the source zip with javascript disabled?
Yes, I'm using Wine 4.16. Can't install the native IE, maybe due to my limited Linux knowledge, maybe for other reasons, and the default XUL replacement doesn't seem to work very well (I get very frequent crashes in POP Peeper too with HTML messages).

Loading the source HTML files would require an open browser, and I try not to use it due to high memory usage (too many add-ons). Otherwise I could just open the online help (which is too slow anyway).
TAC109 wrote:
16 Oct 2019, 20:41
If you can run Microsoft's HTML Help Workshop you can roll your own.
I used to do something like that on XP with every new AHK release but haven't tried that under Mint/Wine. It may well not work because by default - as mentioned above - Wine uses the Mozilla engine to fake the IE core. It would be best if the old-style Help would be provided officially, it may also help XP users.
Part of my AHK work can be found here.
lexikos
Posts: 9559
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

18 Oct 2019, 18:20

TAC109 wrote:
16 Oct 2019, 21:14
In the index.js, some of the entries have 1 or 2 extra fields, e.g. '6,"SSSSESSS"'. Are these fields documented anywhere?
They're for the syntax highlighter, which I think @Ragnar wrote. I just refer to an existing entry to determine the number. The last string seems to be of arg types, String/Expression/Outputvar, the same as in my Lua-based highlighter. For directives that only appear in comments, I suppose they are not relevant.
In the .htm files, under <head> there are entries <title> <meta name=... content=...> . Are the name and content important? Where are they used?
The names have specific meaning to browsers/bots. See <meta> | MDN for "description" and "http-equiv". "X-UA-Compatible" is used to override the default IE7 document mode used by the WebBrowser control/CHM.
User avatar
JoeWinograd
Posts: 2179
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

19 Oct 2019, 14:01

Hi TAC,

The feature I'm looking for may already exist in your Beta_7. If so, please point me to it. If not, I hope you'll consider it for a future enhancement. When a custom icon is present, I'd like an option for the compiler to remove the standard four icons — the red on white H, white on red H, white on green S, and white on red H — leaving only the custom icon in the EXE file.

Btw, I tried doing this with Angus Johnson's ResourceHacker, but (a) it was cumbersome to do and (b) even after getting through the cumbersome process, it was unsuccessful, as the EXE was blocked by the real-time protection of Malwarebytes...maybe because the EXE that I fed to ResourceHacker was compiled with MPRESS. Anyway, a simple check-box in Ahk2Exe for this feature would be awesome, and would preserve the ability to use MPRESS at compile time. Thanks for considering the idea. Regards, Joe
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

19 Oct 2019, 22:55

@JoeWinograd
Nothing like this in the new Ahk2Exe, sorry.

Is your request just for cosmetic reasons? (In case someone looks inside the .exe an sees these icons?)

You can show your own icons for 'suspend' and 'pause' using Menu, tray, icon, ... as I’m sure you are aware.
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)

19 Oct 2019, 23:41

There's a feature request for it here as a command-line parameters:
https://github.com/AutoHotkey/Ahk2Exe/issues/47

I might give a go sometime this week. :+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 Oct 2019, 23:56

@joedf
You know I’m currently updating the help system? It would be helpful if we could freeze the spec!

@JoeWinograd just wanted to remove the icons, not replace them (as I understand).

Is that your understanding?

Edit: Also @JoeWinograd wanted to do this in a Compiler Directive.
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: 2179
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

20 Oct 2019, 03:46

> Is your request just for cosmetic reasons?

It's more than cosmetic. Now that the new compiler directives allow me to set the Properties, the icons inside the EXE, which are visible whenever you create a shortcut and do a Change Icon..., are the last obvious vestige that it was written in AHK. Sure, you can figure that out if you dig deeper, but I'd rather not have it be so obvious.

> In case someone looks inside the .exe an sees these icons?

Yes, but even easier, when you do a Change Icon... on a shortcut:

AutoHotkey icons in compiled EXE file.png
AutoHotkey icons in compiled EXE file.png (28.32 KiB) Viewed 3704 times

> as I’m sure you are aware

Yes, but I always remove the standard icons and use Menu,Tray,Icon for my own icons for custom context menu picks in all my programs. Example:

custom context menu.png
custom context menu.png (18.84 KiB) Viewed 3704 times

> just wanted to remove the icons, not replace them (as I understand)

Correct. Remove them and leave only my one custom icon.

> JoeWinograd wanted to do this in a Compiler Directive

Could be either a Compiler Directive or an option (e.g., checkbox) in the Ahk2Exe GUI.

Regards, Joe
User avatar
joedf
Posts: 8940
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe Changes (2019)

20 Oct 2019, 11:50

@TAC109 no worries, I'll have it in a branch. It can be merged in a later release :+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]
User avatar
JoeWinograd
Posts: 2179
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

20 Oct 2019, 13:46

Hi TAC,
I just discovered today accidentally that the checkbox for MPRESS is not a simple enabled/disabled, but actually offers the UPX choice. I suggest changing the UI for that, as having different choices come up when clicking a checkbox is an unusual and non-obvious UI. That would be much better as a drop-down (like the Base File above it) or a radio button group, imo. Regards, Joe
TAC109
Posts: 1098
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Upcoming Ahk2Exe Changes (2019)

20 Oct 2019, 15:56

@joedf
It would be best to implement this as an icon change Compiler Directive, rather than another parameter to the CLI. @JoeWinograd can then replace all icons with his standard icon, while allowing other users to substitute their own icons if required.

We can implement this before freezing the spec if you wish. Can you knock up a proposed description of the new directive (text only is fine) and I’ll vet it and include it in the help. I find it is useful to document first before coding as it helps to define what is to be achieved, and this way I can have some input prior to implementation. (I’d rather focus most of my attention on the Help updates for now.)

@JoeWinograd
The current compression option has been in the betas since it was first coded. It has the advantage that it is concise, clear as to what has been selected, and is my preferred method of implementing this feature. It will be fully described in the AutoHotkey help, which I’m working on at present.
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: 2179
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Upcoming Ahk2Exe Changes (2019)

20 Oct 2019, 16:14

> It would be best to implement this as an icon change Compiler Directive

Works for me.

> @JoeWinograd can then replace all icons with his standard icon, while allowing other users to substitute their own icons if required.

Perfect!

> We can implement this before freezing the spec if you wish.

That would be terrific!

> The current compression option has been in the betas since it was first coded.

My bad...never clicked on the checkbox, so never noticed it.

> my preferred method of implementing this feature

OK

> It will be fully described in the AutoHotkey help

That will be very helpful.

Thanks again for all your effort on this...very much appreciated! Beta_7 is working perfectly here. Regards, Joe

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Auntiejack56 and 113 guests