Upcoming Ahk2Exe changes

Community news and information about new or upcoming versions of AutoHotkey
User avatar
fincs
Posts: 527
Joined: 30 Sep 2013, 14:17
Location: Seville, Spain
Contact:

Upcoming Ahk2Exe changes

04 Nov 2013, 16:38

I am implementing new functionality in Ahk2Exe, the script compiler; which is now available for testing.

Download (Preview 2a) - this zip file contains Ahk2Exe.exe which you can drop right into your Compiler folder.
Source

New features
  • Ability to change the version information (such as the name, description, version...).
  • Ability to add resources to the compiled script.
  • Ability to tweak several misc aspects of compilation.
  • Ability to remove code sections from the compiled script and viceversa.
Documentation
Have a look at the WIP compiler directives documentation.

Examples
NEW: Bitmap and HTML resource demo (requires at least Preview 1a)

The script below is a very crude example that I used for testing but which should nevertheless show the new capabilities of Ahk2Exe:

Code: Select all

MsgBox Hello

;@Ahk2Exe-SetName Awesome
;@Ahk2Exe-SetDescription Some awesome script
;@Ahk2Exe-SetVersion 1.7.52-beta
;@Ahk2Exe-SetCopyright Copyright (c) 2013`, fincs
;@Ahk2Exe-SetOrigFilename Awesome.ahk

;@Ahk2Exe-AddResource someBmp.bmp
;@Ahk2Exe-AddResource test.html
;@Ahk2Exe-UseResourceLang 0x340A
;@Ahk2Exe-AddResource test_sp.html, test.html

;@Ahk2Exe-IgnoreBegin
MsgBox This will appear in the uncompiled script!
;@Ahk2Exe-IgnoreEnd

/*@Ahk2Exe-Keep
MsgBox This will appear in the compiled script!
*/

MsgBox Bye
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
User avatar
oldbrother
Posts: 265
Joined: 23 Oct 2013, 05:08

Re: Upcoming Ahk2Exe changes

05 Nov 2013, 22:18

Nice!
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

29 Nov 2013, 03:00

Can't wait for it to be the official release :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
fincs
Posts: 527
Joined: 30 Sep 2013, 14:17
Location: Seville, Spain
Contact:

Re: Upcoming Ahk2Exe changes

06 Dec 2013, 13:30

Uploaded Preview 2, see git log:

Code: Select all

Do not use LastIcon and LastBinFile if those files do not exist
----
Add new directives, see details:

;@Ahk2Exe-SetCompanyName txt
    Obvious
;@Ahk2Exe-SetMainIcon [icoFile]
    Overrides the exe icon used for compilation. If the icon parameter
    is not specified, the icon is left as the default AHK icon.
;@Ahk2Exe-PostExec command
    Executes a command after compilation.
;@Ahk2Exe-UseSeparateTrayIcon
    Makes the AHK runtime continue to use the separate tray icon
    resource as in compiled scripts with no custom icon.
;@Ahk2Exe-SetConsoleSubsys
    Changes the executable subsystem to Console mode.
Todo list:
  • Add support in directives for specifying things such as %A_ScriptFullPath%.
  • Add support for changing or adding arbitrary fields in version info.
  • Add support for replacing and deleting resources.
  • Icon resource support.
  • If there is enough demand: cursor resource support.
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

06 Dec 2013, 13:51

Hoorrray! You've added the Console subsystem! :D
Yay! Mister LibCon.ahk will be happy :D
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]
step
Posts: 3
Joined: 29 Mar 2014, 12:43

Re: Upcoming Ahk2Exe changes

29 Mar 2014, 13:02

It took me a while to find the new home of this thread, I was still hanging out the old forum; I didn't realize this is where the action is. Well, now I know. Back on topic now.
I was intrigued about the AddResource directive and played a little with the Bitmap and HTML resource demo (download from the first post). So I figured how to add PNG resources and use them in an HTML resource.

Code: Select all

;@Ahk2Exe-AddResource test.png
;@Ahk2Exe-AddResource test.html

Code: Select all

<!DOCTYPE html>
<html><head></head><body>
    <img src="res://test.exe/10/test.png">
</body>
</html>
Note that the script exe name test.exe must be embedded into the resource file. This isn't ideal (limits renaming and portability), but I couldn't figure out another way to make the res:// protocol find the png resource. I think the filename suffices as long as it's in the PATH or in the working dir. See references for more info.
10 is the RCDATA resource type, works for png. Use 2 for bmp.

References:
res protocol: http://support.microsoft.com/kb/220830 and http://msdn.microsoft.com/en-us/library ... 85%29.aspx
resource types: http://msdn.microsoft.com/en-us/library ... 85%29.aspx

Edit:
Possibly a work-around for needing to embed the script exe name could be for the script to create a hard or soft link to %A_ScriptFullPath% and specify the link name in the res:// protocol line. It should work (untested).
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

21 Apr 2014, 02:48

I wonder... When is this gonna replace the main "branch".
Does it still have any know stability issues? Just curious... :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
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

Re: Upcoming Ahk2Exe changes

27 Oct 2014, 02:42

Is there anything new fincs? A possible release date?
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

27 Oct 2014, 03:05

Yes, for now I'm not using it. I am waiting for it to be the "stable" release. I really want to use those directives :P
It would be good to actually have these directives IN the Ahk docs too, once it is "Stable".
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]
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: Upcoming Ahk2Exe changes

27 Oct 2014, 04:06

Yes, it will be nice to see these changes in stable version of AutoHotkey.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: Upcoming Ahk2Exe changes

30 Oct 2014, 06:17

@finc when will this be released in the stable AutoHotkey installer?
User avatar
fincs
Posts: 527
Joined: 30 Sep 2013, 14:17
Location: Seville, Spain
Contact:

Re: Upcoming Ahk2Exe changes

30 Oct 2014, 10:48

I currently consider this low priority due to my lack of time to finish it and apparently the lack of demand. Nonetheless I hope to finish it in the future.
fincs
Windows 11 Pro (Version 22H2) | AMD Ryzen 7 3700X with 32 GB of RAM | AutoHotkey v2.0.0 + v1.1.36.02
Get SciTE4AutoHotkey v3.1.0 - [My project list]
User avatar
xZomBie
Posts: 256
Joined: 02 Oct 2013, 02:57

Re: Upcoming Ahk2Exe changes

30 Oct 2014, 23:50

I hope that the future is near. :D
Just realized that I spelled your name wrong... Sorry about that fincs...
Peter2
Posts: 325
Joined: 21 Sep 2014, 14:38
Location: CH

Re: Upcoming Ahk2Exe changes

13 Dec 2014, 13:11

fincs wrote:.... and apparently the lack of demand. ...
The demand is here - but this release is not so easy to find...
Peter (AHK Beginner) / Win 10 x64, AHK Version v1.1.33
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

13 Dec 2014, 19:56

+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
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

24 Dec 2014, 06:25

For /NoDecompile discussion, please go to the following topic : http://ahkscript.org/boards/viewtopic.php?f=13&t=5699
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]
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Upcoming Ahk2Exe changes

04 Jan 2015, 12:10

It seems the tray icon not changed, only main icon.
Bruttosozialprodukt
Posts: 463
Joined: 24 Jan 2014, 22:28

Re: Upcoming Ahk2Exe changes

04 Jan 2015, 22:07

I'm soo stoked for this!
Especially for the version info. But adding resources sounds awesome too.

And I agree this is too hard to find. It didn't show up for me when I googled for "autohtkey alternative compiler".
User avatar
joedf
Posts: 8937
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Upcoming Ahk2Exe changes

04 Jan 2015, 22:29

;@Ahk2Exe-SetConsoleSubsys
is really cool, since ahk will "official" support scripting console "apps"..
I do think that when this is a stable release, that all these ahk2exe directives should be thoroughly documented in the ahk documentation. ;)
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]
lexikos
Posts: 9494
Joined: 30 Sep 2013, 04:07
Contact:

Re: Upcoming Ahk2Exe changes

05 Jan 2015, 06:30

Why not ;@Ahk2Exe-SetTrayIcon to go with ;@Ahk2Exe-SetMainIcon instead of ;@Ahk2Exe-UseSeparateTrayIcon?

One useful resource type not mentioned in the documentation is 24 - the executable manifest. The most useful edit is to change the requestedExecutionLevel element's level attribute to requireAdministrator. The manifest must have ID 1:

Code: Select all

;@Ahk2Exe-AddResource *24 AutoHotkey.exe.manifest, 1

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 13 guests