[*:1k1o3k9v]Installer for AHK
[*:1k1o3k9v]Installer for AHKL
NOTE: You may need to Run as administrator (right click the bat and choose this option).
This is .bat file which you should save in the AHK(_L) folder.
When you run it, it will associate AHK executable with ahk scripts, associate icon and extension handler.
It can also be used with any other app, just change SETUP section as needed.
This batch script allows you to copy AHK folder to different computers without using official installer and quickly associate it with AHK. Its also handy for testing different AHK branches as you can only add or remove "l" to extension to run the script with different ahk branch.
If your file is named
[*:1k1o3k9v] Test.ahk it will run in AutoHotKey
[*:1k1o3k9v] Test.ahkl it will run in AutoHotKey_L
[*:1k1o3k9v] Test.ahkXXX will run AutoHotKeyXXX. XXX is something of your choosing - specific version of AHK or branch. Add the extension you like, change the bat file SETUP section and thats it.
You may wonder, why not using AHK to do this. The answer: AHK may not be installed. Batch is system script and it works on every computer.
The quick way to deduce what will run is to notice the icon in explorer.
To use the single portable folder for stdlib, make NTFS junction in AutoHotKey_L folder from AutoHotKey folder. To do this, you can for instance use this little app:
junction.exe d:\Utils\AutoHotKey_L\Lib d:\Utils\AutoHotKey\Lib
Or better, keep Libs out of AHK folders and junction to both of them. Then you add new libs only to this folder and they will be automatically seen by both versions of AHK (or multiple versions if you have them). That way you don't risk deleting Libs if for some reason you choose to delete your AHK folder and reinstall it.