AHK-EXE-Swapper allows you to quickly and easily swap which version (ie 1.2.3) and variant (ie Ascii / Unicode / x86 / x64) of AutoHotkey you wish to use for all scripts. It also allows you to replace your AHK EXEs with those from zips of Lexikos' test releases of AHK and HotkeyIt's releases of AHK_H
Previous versions that you have used will be backed up in a library, and you can swap out to them as long as no scripts are currently using Autohotkey.exe
GitHub Page
[Tool] AHK-EXE-Swapper. Swap AHK version quickly!
[Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Last edited by evilC on 28 Aug 2016, 14:22, edited 2 times in total.
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
this is cool!
also, you can change the basically used 'AutoHotkey.exe' by modifying the registry
on HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open\Command
the default data is "C:\Program Files\AutoHotkey\AutoHotkey.exe"
so you can change it by using RegWrite
for example, C:\Program Files\AutoHotkey\AutoHotkeyA32.exe" will use ANSI version of AHK by default
also, you can change the basically used 'AutoHotkey.exe' by modifying the registry
on HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open\Command
the default data is "C:\Program Files\AutoHotkey\AutoHotkey.exe"
so you can change it by using RegWrite
for example, C:\Program Files\AutoHotkey\AutoHotkeyA32.exe" will use ANSI version of AHK by default
AutoHotkey & AutoHotkey_H v1.1.22.07
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
added to "[AutoHotkey Programming Tools]" (http://ahkscript.org/boards/viewtopic.php?f=6&t=3376)
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]
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
First off, the instructions are now right, you do only need the EXE and not the get_info.ahk file - everything is now internal.
Secondly, AHK-EXE-Swapper now has basic support for AHK v2 .
Back up your current AHK version ,delete the 3 EXEs in the AHK folder.
Download BOTH v2 EXEs and rename them AutoHotkeyU32.exe and AutoHotkeyU64.exe, place them in the AHK folder.
Run the script (or refresh) and it will detect V2 installed. Hit "Backup" and it will add the v2 EXEs to your library - you can now swap v1 and v2 in and out easily.
Secondly, AHK-EXE-Swapper now has basic support for AHK v2 .
Back up your current AHK version ,delete the 3 EXEs in the AHK folder.
Download BOTH v2 EXEs and rename them AutoHotkeyU32.exe and AutoHotkeyU64.exe, place them in the AHK folder.
Run the script (or refresh) and it will detect V2 installed. Hit "Backup" and it will add the v2 EXEs to your library - you can now swap v1 and v2 in and out easily.
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Updated repo - the EXE swapper now supports AHK_H.
The naming format of the folders in the Versions folder has changed, whereas before it was like 1.1.23.05, it is now like 1.1.23.05 (AHK_L) or 1.1.24.00 (AHK_H v019) (Always 3 spaces, less and the UI looked too cluttered)
I also made it run as admin if needed, and added a debug mode var at the start for simpler / non-SciTE debugging.
[Update] It now swaps in the correct version of msvcr100.dll needed for AHK_H also
The naming format of the folders in the Versions folder has changed, whereas before it was like 1.1.23.05, it is now like 1.1.23.05 (AHK_L) or 1.1.24.00 (AHK_H v019) (Always 3 spaces, less and the UI looked too cluttered)
I also made it run as admin if needed, and added a debug mode var at the start for simpler / non-SciTE debugging.
[Update] It now swaps in the correct version of msvcr100.dll needed for AHK_H also
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Keep up the good work
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]
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Hi EvilC,
I am interested in using your tool but can't seem to get it to run. I downloaded a copy from your GitHub page, made sure that I had no running scripts, and tried to run both the .exe and the .ahk versions. When I click on one of the variants I get the error: "Could not delete AutoHotkey.exe. Do you have any scripts running? If so, stop them and try again". I am running AHK 1.1.24.03 and A_AhkPath is C:\Program Files\AutoHotkey\AutoHotkey.exe.
Thank you for your help.
I am interested in using your tool but can't seem to get it to run. I downloaded a copy from your GitHub page, made sure that I had no running scripts, and tried to run both the .exe and the .ahk versions. When I click on one of the variants I get the error: "Could not delete AutoHotkey.exe. Do you have any scripts running? If so, stop them and try again". I am running AHK 1.1.24.03 and A_AhkPath is C:\Program Files\AutoHotkey\AutoHotkey.exe.
Thank you for your help.
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
@iPhilip - Is it maybe a permissions issue? Have you tried running the EXE version as admin?
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Thanks. That worked.
I was thrown off by your comment above:
I was thrown off by your comment above:
Cheers!evilC wrote:I also made it run as admin if needed ...
Windows 10 Pro (64 bit) - AutoHotkey v2.0+ (Unicode 64-bit)
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
I do not get AHK-exe to work. (and am not sure that I understand the function).
Now I have three files (version1) in the C:\Program Files\AutoHotkey
AutohotkeyA32-1.exe, AutohotkeyU32-1.exe, AutohotkeyU64-1.exe
and two files
AutohotkeyU32-2.exe, AutohotkeyU64-2.exe
and one file
Autohotkey.exe
If I run this program, I believe that the current AHK version appears
Now if I want to change the version, the Autohotkey.exe is deleted, and any of the other versions is copied to the name Autohotkey.exe
(it seems to work)
But if I try to run AHK-EXE-Swapper as administrator, it doesn't work for me.
I got an error message "... Backup Versions do not match main AHK-Version. or files are missing! ..."
In the "version" field I have both "1.1.25.01....." and "2.0-1078-19....."
//Jan
Now I have three files (version1) in the C:\Program Files\AutoHotkey
AutohotkeyA32-1.exe, AutohotkeyU32-1.exe, AutohotkeyU64-1.exe
and two files
AutohotkeyU32-2.exe, AutohotkeyU64-2.exe
and one file
Autohotkey.exe
If I run this program, I believe that the current AHK version appears
Code: Select all
MsgBox %A_AhkVersion%
(it seems to work)
But if I try to run AHK-EXE-Swapper as administrator, it doesn't work for me.
I got an error message "... Backup Versions do not match main AHK-Version. or files are missing! ..."
In the "version" field I have both "1.1.25.01....." and "2.0-1078-19....."
//Jan
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
It works like this:
1) Install AHK as normal
2) Launch the app, click "Backup Current Version".
This copies the AHK exes from the install folder to C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Versions
3a) If a new AHK_L version comes out, download it and run the installer.
Then go into the app and click "Backup Current Version" again.
3b) For AHK_H releases, or AHK_L betas (Without installer) and maybe this applies to v2 AHK as well?
Copy the zip into C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Import
Then open the app, click "Refresh all", then select the zip, then click "Import Selected Version"
4) Once versions are in your library, you can select them from the top list and select "Replace with selected version".
So basically, the mistake you are making is that it does not rely on files in the C:\Program Files\AutoHotkey folder, but it stores "Other versions" in C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Versions
You populate versions by overwriting ALL the current EXEs (AutoHotkeyA32.exe, AutoHotkeyU32.exe, AutoHotkeyU64.exe) with new ones, and then clicking "Backup Current Version".
This will add it to the "library" of versions.
1) Install AHK as normal
2) Launch the app, click "Backup Current Version".
This copies the AHK exes from the install folder to C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Versions
3a) If a new AHK_L version comes out, download it and run the installer.
Then go into the app and click "Backup Current Version" again.
3b) For AHK_H releases, or AHK_L betas (Without installer) and maybe this applies to v2 AHK as well?
Copy the zip into C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Import
Then open the app, click "Refresh all", then select the zip, then click "Import Selected Version"
4) Once versions are in your library, you can select them from the top list and select "Replace with selected version".
So basically, the mistake you are making is that it does not rely on files in the C:\Program Files\AutoHotkey folder, but it stores "Other versions" in C:\Program Files\AutoHotkey\AHK-EXE-Swapper\Versions
You populate versions by overwriting ALL the current EXEs (AutoHotkeyA32.exe, AutoHotkeyU32.exe, AutoHotkeyU64.exe) with new ones, and then clicking "Backup Current Version".
This will add it to the "library" of versions.
You do not need to do this, it already self-elevates to admin.But if I try to run AHK-EXE-Swapper as administrator, it doesn't work for me.
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
My ahk release version is installed in `d:\TechnicalSupport\ProgramFiles\AutoHotkey`, using the official installer exe, but the AHK-EXE-Swapper seems not detect this install path correctly.
I place AHK-EXE-Swapper in `d:\Downloads\AHK-EXE-Swapper`. When I click `backup` in AHK-EXE-Swapper's UI, not only does it create the correct backup (possibly because it cannot find the install path), but at the same time it creates three folders under the `C:\Program Files\AutoHotkey\AHK-EXE-Swapper`.
Run regedit in my machine, `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open\Command` says "d:\TechnicalSupport\ProgramFiles\AutoHotkey\AutoHotkey.exe" "%1" %*
Win7x64 AutoHotkey v1.1.25.01
I place AHK-EXE-Swapper in `d:\Downloads\AHK-EXE-Swapper`. When I click `backup` in AHK-EXE-Swapper's UI, not only does it create the correct backup (possibly because it cannot find the install path), but at the same time it creates three folders under the `C:\Program Files\AutoHotkey\AHK-EXE-Swapper`.
Run regedit in my machine, `HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AutoHotkeyScript\Shell\Open\Command` says "d:\TechnicalSupport\ProgramFiles\AutoHotkey\AutoHotkey.exe" "%1" %*
Win7x64 AutoHotkey v1.1.25.01
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
The code EnvGet, AhkFolder, ProgramW6432 is used by the code to detect the program files folder, then appends AutoHotkey to it.
I guess this does not work in your case.
The problem is that the app must be run WITHOUT using your AHK install, as it needs to change the AHK EXE.
So as I am not running using the installed version of AHK, I cannot use A_AhkPath to detect the AHK install folder.
What I may have to do is something like have the code write an AHK script that reads A_AHKPath, save it to temp folder and run it, then retrieve the path to AHK like that.
Failing that, I would need to start looking in the registry or something to find the AHK folder.
I guess this does not work in your case.
The problem is that the app must be run WITHOUT using your AHK install, as it needs to change the AHK EXE.
So as I am not running using the installed version of AHK, I cannot use A_AhkPath to detect the AHK install folder.
What I may have to do is something like have the code write an AHK script that reads A_AHKPath, save it to temp folder and run it, then retrieve the path to AHK like that.
Failing that, I would need to start looking in the registry or something to find the AHK folder.
Re: [Tool] AHK-EXE-Swapper. Swap AHK version quickly!
Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: submeg and 122 guests