Here's one of the few "easy" ways to not only setup any version of AHK to work on your system, but to also easily switch back and forth.
=======================================================
NOTE: This assumes you have made (or will make) custom folders for your different versions of AutoHotkey (the EXE file of course). This method is meant to allow you to switch versions quickly and easily, NOT to use multiple versions at the same time.
Like many other users on this forum, I do NOT recommend that you try to apply other extensions other than the
.ahk extension. Most users on this forum will only release
.ahk files for their scripts. Furthermore, AutoHotkey_H has several libraries, all with the
.ahk extension. Trying to use another extension would mean renaming all those files, and modifying all the
#INCLUDE entries for all those dependencies and libraries. You would also have to do this for MOST future AHKv2 script, since most users will still use the
.ahk extension.
From almost any angle, it's more trouble than it's worth trying to setup another extension. I actually considered (and tried it) for a short while, only becuase I had not yet developed the below method at that time. For me, the below method is FAR better than setting up a separate extension for AHKv2.
=======================================================
Here's an easy solution to swith AHK versions quickly:
1) Download the attached file.
2) Place a copy of the
.reg files in each AHK version folder you use. For example I have the following folders:
AutoHotkey v1.1.32.00
AutoHotkey v2.0-a108-a2fa0498
3) Open the
_AHK_Install.reg file in a text editor and fill in the two entries that point to the AutoHotkey.exe file for EACH version of AutoHotkey you are intending to run (which also associates it with the
.ahk extension). So if you are running AHKv1 and v2, you should have a minimum of two of these files. You only need one
_AHK_Uninstall.reg file. In theory you can modify one of these .reg files for every type of AutoHotkey EXE file, so you can switch between ANSI, UNICODE, 32-bit, and 64-bit. How you choose to set this up is up to you.
IMPORTANT NOTE: If I'm not mistaken, when you use the AHK installer, the version of AHK you select (Unicode x86, Unicode x64, or ANSI) is copied to
AutoHotkey.exe.
The ANSI version (32-bit) is:
AutoHotkeyA32.exe <-- this version comes with AHKv1
The 32-bit Unicode version is:
AutoHotkeyU32.exe <-- this version comes with AHKv1 and v2
The 64-bit Unicode version is:
AutoHotkeyU64.exe <-- this version comes with AHKv1 and v2
Do one of the following:
a) Simply copy/paste the version you want to use within the same folder, and rename it to AutoHotkey.exe. The other versions are technicallly not needed, but if you want to switch (testing, preference, or any reason) then it's handy to keep those files around.
b) Specify a specific AutoHotkey EXE file (ie. AutoHotkeyU32.exe, or AutoHotkeyU64.exe) in the .reg file witout making a separate copy. Be sure to change all the appropriate entries.
4) Optionally, in the .reg file, change the line that points to
notepad.exe to point to your own custom text editor. The default is
C:\Windows\notepad.exe. Remember that when modifying a path in a
.reg file, you must use two backslashes
\\ to separate folders, not one.
5) Optionally, in the .reg file, change the "ShellNew" entry to use a custom template. Check the comments (starting with semi-colon
;) for which paths to change.
This method works best with zip files. Using the EXE installers is not necessary.
All AutoHotkey Versions (linked from the AutoHotkey Download page):
AutoHotkey 1.1.*
AutoHotkey 1.0.*
AutoHotkey 2.0-a*
==========================================
EDIT: Updated the
_AHK_Install.ahk to include the "ShellNew" entries in the
.ahk file type. This defines the template used when using the Right-Click menu in the File Explorer and selecting New > AutoHotkey Script. This can be customized to use templates you specify in a custom location.