Test build - /include, compile with exe, ~custom combo fix

Community news and information about new or upcoming versions of AutoHotkey
Post Reply
lexikos
Posts: 7506
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Test build - /include, compile with exe, ~custom combo fix

Post by lexikos » 11 May 2021, 17:21

This test build includes:

  • A new command line switch /include path, includes a single file (or a named pipe or stdin, as usual) before the main script. Only one is supported. It is retained when reloading the script. When executing a compiled script without the /script switch, /include is not interpreted (it is passed to the compiled script). It might have uses such as:
    • Including common settings or modified functionality for all scripts executed on a system (by adding /include into the registry).
    • Integrating editors and other tools, such as enabling #Warn All, StdOut or hooking runtime errors with OnError.
  • The ability to compile a script based directly on an exe, and use it to execute external scripts. Details as in this post, with the following changes:
    • /execute has been renamed to /script.
    • If present, RCDATA resource ID 2 is automatically #included before every script the exe loads, regardless of whether resource ID 1 is present. This can be used for purposes similar to /include, but embedded in the exe file itself.
  • A fix for the behaviour of the tilde (~) prefix when applied to the prefix key in context-sensitive custom combinations. Details here.

AutoHotkey_1.1.34-TEST+g327448e9.zip
User avatar
TheArkive
Posts: 555
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: Test build - /include, compile with exe, ~custom combo fix

Post by TheArkive » 15 May 2021, 08:16

I've looked into enumerating and updating resources and I understand the general concept. If one were to embed the RCDATA resource type into any other AHK exe version other than this test version, (of course assuming the old name of >AUTOHOTKEY SCRIPT<), is it correct to assume those older exe's are not designed to execute that resource?

Is that by chance one of the the main purposes of the .bin files? To be able to look for an embedded script and execute it?

I'm trying to picture in my head the over-arching order of operations. I'm looking into Ahk2Exe code now to try and learn. Like drinking from a fire hose... (still fun though).

I'm aware the answer is likely more complex than my questions imply, I'm just trying to wrap my head around the main concepts so I can figure out how to properly connect the dots in my head.
lexikos
Posts: 7506
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Test build - /include, compile with exe, ~custom combo fix

Post by lexikos » 16 May 2021, 23:03

Correct.

The bin files omit other things that aren't needed for compiled scripts, like #include and some load time validation. The previous exe files omitted some things only used by compiled scripts, like code for reading a stream of text from memory instead of a file, and the implementation of Menu Tray, MainWindow.

The new exe files use resource ID 1, as I noted in the Ahk2Exe topic.
Post Reply

Return to “Announcements”