Armored Autohotkey executable builder
0.9.5b
INTRO USAGE OPTIONS INTERFACE RESOURCES VERSIONINFO EXECUTION OUTRO
OPTIONS MACROS

All the following HKC_ options can be declared either as system environment variables or within a script or config file. (file based options override identical environment options)

These options are only looked for in the first script or config file that  you::
 And not when you type the path  to the file in the  inputbox adjacent  to the button marked input.

When options are not defined / their default value which depends on the option is either 0 or an empty string ""..

     ~ = Only required for config files or when used as an environment variable.
    * = Value is optional if default is correct.
HKC_IN
~
AutoHotkey script path.

When used in a config file this value can be a relative path to the config dir if a full path was given to load the config.

When used as an environment variable this value can contain a path to a script or a config file.
HKC_OUT
*
Output executable path.

If not defined the scriptname with an exe extension will be used.
HKC_ICO
*
Main Icon path.

Ahk2Exe handles inclusion and uses icongroup index 159 lang 1033 for this icon, try to remember that if you add icons to your executable that the icon with a lower index value will be the default app icon and not this one.
HKC_A2E
*
Alternate path to Ahk2Exe.

Only required if HkC cannot find this file in one of two possible default locations explained here

Upx if not found elsewhere is also searched for in the directory path of this file. *New*
HKC_BIN
*
Alternate path to AutoHotkeySC.bin

Same as hkc_a2e.
HKC_VER
*
A supported AutoHotkey build version value which is represented by either its index or ID or full version string.

INDEX ID FULL VERSION   INDEX ID FULL VERSION
0 AUTO A.U.T.O 14103901. 0. 39. 0
1 102514 1. 0. 25. 14 151040121. 0. 40. 12
2 10261 1. 0. 26. 1 16104121. 0. 41. 2
3 10271 1. 0. 27. 1 17104271. 0. 42. 7
4 10281 1. 0. 28. 1 181043111. 0. 43. 11
5 10290 1. 0. 29. 0 191044141. 0. 44. 14
6 10304 1. 0. 30. 4 20104541. 0. 45. 4
7 10317 1. 0. 31. 7 211046171. 0. 46. 17
8 10320 1. 0. 32. 0 22104751. 0. 47. 5
9 10331 1. 0. 33. 1 23104761. 0. 47. 6
10 10340 1. 0. 34. 0 24104831. 0. 48. 3
11 103516 1. 0. 35. 16 25 10485 1. 0. 48. 5
12 10367 1. 0. 36. 7 26 10485La 1. 0. 48. 5La
Lexikos - ansi
13 10386 1. 0. 38. 6 27 10485Lw 1. 0. 48. 5Lw
Lexikos - unicode

Autodetect / crc checks explained,
Used by default when no value is defined in hkc_ver or autodetect is defined as shown in the table below.
Hkc uses crc checks to identify the type of build you are using so it can select the correct offset maps when it comes to making modifications to the build files, otherwise it will surely break the temp files.

Even if you do not use the autodetect option and specify a version, crc checks are performed on the build files anyway as a failsafe against accidentally selecting the wrong version. This particular check can be disabled with the ~ns commandline switch or through the gui.


HKC_RND
*
Data sequence camouflage seed, accepts numbers and characters:
  • "" = Empty or not defined uses an internal mechanism to seed.
  • -1 = Erases the data sequences instead of scrambling them.
  • User defined number/string combination is used to seed.


When the commandline switch ~np is used to disable protective camouflage this option and its values change like so::
  • "" = Empty or not defined, no password is used.
  • User defined number/string combination is used as the password.
HKC_ALT
*
Define alternate upx or other packer commandline string that Ahk2Exe uses when it builds your executable.

If hkc_alt = "" and hkc_pak = 1, The default hardcoded upx command string will be used which is::

   "%supx.exe" --best --filter=73 --lzma --compress-icons=0 "%s"



If hkc_alt <> "" and hkc_pak = 1, The original C string above will be replaced with the contents of hkc_alt which needs to adhere to a couple of important rules related to the C string and its use by Ahk2Exe.

The command string can be 61 characters long or less.

The string is passed to the shellexecute function so what you are calling does not have to be an exe as long as the file extension is registered executable by your system, a .bat or .ahk script for example.

Ahk2Exe uses the C string token '%s' as markers for 2 separate values::

   "%supx.exe" --best --filter=73 --lzma --compress-icons=0 "%s"
    ^= HkC+Ahk2Exe directory\   and  The full ouput exe path =^

Both of these tokens need to exist in your alternate command string for the correct values to be replaced in the correct order by Ahk2Exe.

So something like this example to try and execute upx that exists in a directory declared in the system path environment variable instead of Ahk2Exe's directory by dropping one of the C tokens::


   "upx.exe" --best --filter=73 --lzma --compress-icons=0 "%s"
   
                                HkC+Ahk2Exe directory\ =^

Would fail miserably because of the order Ahk2Exe is processesing the tokens returning the directory instead of the file path.

The fault of this rests entirely on myself and the hack and slash method I chose to perform this task.
  • First instance of '%s' always = HotkeyCamo's directory\
To get rid of this token you should use it as intended and put the executable file in HkC's directory, so it can then be used like this::

   <"%smpress.exe"> -s "%s"
   
^= Token + Filename to execute wrapped in double quotes.
  • Second instance of '%s' always = The output executable path
It should just be %s wrapped in double quotes, it can exist anywhere in the command as long as it is the second instance.



Important notes
  • Ahk2Exe executes the process of this command in hidden mode.
  • HkC is waiting for Ahk2Exe which is also waiting for this process.
  • No real way to gauge success or errors as yet.
  • HkC currently does not check this string other than its length.
  • No HkC macros can be used in this string.
  • Environment vars can only be used if the process supports them.
HKC_TMP
*
Delete the temp build files created after use.
  • 0 or Undefined = yes
  • 1no
If no is chosen HkC will move all temps to the folder of the script after the build operation finishes.

Repeat builds will overwrite temp files that already exist.
HKC_PAK
*
Let Ahk2Exe pack the output exe with upx default settings, or enable the use of the alternate pack string defined in hkc_alt.
  • 0 or Undefined = no - Disable packing.
  • 1 = yesEnable packing.
HKC_DBG
*
Display more verbose output in the log.
  • 0 or Undefined = no
  • 1 = yes
HKC_SUB
*
Set the output exe's subsystem to console.
(
For command shell based scripts.)
  • 0 or Undefined = no
  • 1 = yes
HKC_EAR
*
Erase the original interpreter resource table.
  • 0 or Undefined = no
  • 1 = yes
This has no ill effects on any other resource based options.

MACROS

Simple abbreviations for files and folders related to HkC and your build, They can be used in configurable options passed as environment variables or in a file or the gui  that expect  file/path information.

Macros Files::
  • @IN>  : The path to the script file.
  • @OUT> : Output executable path.
  • @ICO> : The path to the main icon. (only if specified)
  • @AHK> : Full path to AutoHotkey. '@CDP>AutoHotkey.exe'
  • @PAK> : Full path to upx. '@CD>UPX.exe'
  • @A2E> : Path to the temp copy of Ahk2Exe, '@CD>A2ECamo.exe'
  • @BIN> : Path to the temp bin file,'@CD>AutoHotFuzzy.bin'
Directories::
  • @SD>  : Full directory path of the script.
  • @SDP> : Parent directory path relative to the script directory.
  • @CD>  : Full directory path of HotkeyCamo.
  • @CDP> : Parent directory path relative to HkC's own directory.
* Directory macros always end with a trailing ' \' backslash *
Environment
Variables
Can be used in addition to macros.

As long as the variable exists in HkC's environment block at runtime it will be processed.

Example: using an environment variable in an option.
  hkc_out = %userprofile%\Desktop\My.exe

Example: (batch) using a user set environment variable.
  SET UDIR = x:\MyPath
  HKC.exe %cd%\Myconfig.cfg

Inside Myconfig.cfg
  hkc_in = %UDIR%\Myscript.ahk