Page 1 of 3

AHK Portable Installer v1.10

Posted: 27 Feb 2020, 16:50
by TheArkive
AHK Portable Installer
ahk-pi2.png
ahk-pi2.png (11.96 KiB) Viewed 5264 times
GUI expanded
=======================================================================

Key features:
  • Associate the .ahk extension with any version of AHK on double-click.
  • Selectively choose which context-menu items appear in the context menu.
  • Associate any text editor with "Edit Script" in context menu easily.
  • Define as many versions of AHK as you want to run in parallel.
  • Automatically launch the appropriate compiler from "Compile Script" context menu.
  • Checks for updates when prompted, or does so automatically if enabled.
  • Displays the latest versions of AHK v1 and v2 (with internet connection of course).
  • Displays currently active version of AHK.
  • Provides links to AHK v1 and v2 download pages / version archives.
  • Allows you to invoke WindowSpy.ahk and help file for active AHK version from GUI.
  • Easy access to edit templates for new AutoHotkey.ahk files from GUI.
Yes this modifies the registry. I've been using this tool for a while now without issues. I'm happy to get feedback and give support for this project!

I've tested this on a fresh install of windows and it works like a charm. Just have to restart after activating an EXE (writing the registry keys) the first time, but after that, future switching doesn't require a restart.

Download on GitHub
>> Source
>> Change Log / Releases


If you need a version of Window Spy for AHK v2, go to this thread.

Re: AHK Portable Installer v1

Posted: 28 Feb 2020, 02:39
by elModo7
I was doing something similar the easy way, a portable editor, ahk.exe and most common tools.
This might be great if working on an external usb in a more serious manner.

Thanks for the share!

Re: AHK Portable Installer v1.2

Posted: 28 Feb 2020, 11:46
by TheArkive
AHK Portable Installer v1.2 now up.

@elModo7 - no problem! Just trying to contribute something useful. This is actually my go-to method now. I'm not using the installer anymore because I wan't to quickly and easily switch between versions for compatibility testing and quick/easy compiling to multiple versions.

Re: AHK Portable Installer v1.3 - UPDATE!

Posted: 12 Mar 2020, 15:06
by TheArkive
Added an AhkLauncher.exe

This will look for:
_AHKv# at the end of a file name
or
; AHKv# as line 1 in the script

Of course replace # with 1 or 2 corresponding to the AHK version.

You can define the AHK exe to use for v1 and v2 separately in the main window settings.

Re: AHK Portable Installer v1.4 - UPDATE!

Posted: 13 Mar 2020, 05:59
by TheArkive
Changes:
  • fixed script workingDir when using AHK Launcher
  • added: remember GUI position on exit
  • added: adjust GUI position if expanding below screen border
  • added: Auto Start and Auto Open for compiler using fancy AHK Handler
  • fixed: handling of removing registry entries when switching active/installed AHK exe
  • minor update v1.45:
    - fixed minor GUI misalignment
    - added option to disable tooltips

Re: AHK Portable Installer v1.5 - UPDATE!

Posted: 14 Mar 2020, 02:03
by TheArkive
Changes:

added registry checks on startup - this serves as a check to ensure program settings are properly recorded in the registry. This is useful when:
  • running separate instances of this program on the same PC (not sure why you would)
  • reinstalling AHK after a fresh install of Windows
Before this update, if you install/activate an EXE, and subsequently format your OS harddrive and reinstall Windows, of course the portable program would still show AHK as installed which isn't correct. This fixes that issue, and instead will display Registry mismatch!.

Please post bugs and issues!

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 05:48
by hoppfrosch
Could you please elaborate how to INSTALL Autohotkey with your tool?
Assumed I have NO Autohotkey on my system yet - whats the way to install AHK v1 and v2 parallel using your tool? Whats the suggested folder structure?

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 06:40
by TheArkive
hoppfrosch wrote:
17 Mar 2020, 05:48
Could you please elaborate how to INSTALL Autohotkey with your tool?
Assumed I have NO Autohotkey on my system yet - whats the way to install AHK v1 and v2 parallel using your tool? Whats the suggested folder structure?
Sorry for not being clear. I'll try again.

It's best to use the following structure (simple):

Code: Select all

myAHKroot_folder\
             ...\a_version_of_AHK
             ...\another_version_of_AHK
             ...\ect
Then set the Base AHK Folder (first option, first tab) in the program to whatever myAHKroot_folder is:

At this point the list should populate. ALL exe's are listed, but all instances of AutoHotkey.exe are omitted, since these are just copies of one of the pre-existing EXEs.

Once the list is populated, make sure to FIRST set all options you want to use. If you want to use the AHK Launcher (to run AHK v1 and v2 side by side), then visit the Extras tab.

Once all options are set as desired, then "activate" an EXE (basically activate = install). Doublel-click, or select and click the Activate EXE button.

Now restart. AHK should now be associated with .ahk extension.

This is the basic setup, assuming all defaults are used, and NOT using the AHK Launcher.

=============================================================

If you use the AHK Launcher, then you need to specify the EXE you want to use (64-bit / 32-bit / ANSI / etc) for both AHK v1 and v2.

Also, when using the method, you must modify your scripts as shown on the GitHub page.

The AHK Launcher looks for the identifying modifications to determine which version of AHK to use to launch the script.

If none of the identifying modifications are present, then the script is launched with the activated / installed version of AHK as a fallback.

=============================================================

Please let me know if this still isn't making sense.

EDIT: this isn't a full description of the setup, just a basic setup. The reboot is the key part, aside from activating / installing a specific version. When I say version, I mean a combination of bitness, AHK version, and type (Unicode or ANSI). So each release of AHK comes with 2 or 3 "versions" technically.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 06:59
by hoppfrosch
Thanks for your fast response.

As you need preinstalled Autohotkey on your machine using your tool, I am not quite sure whether your choosen name "AHK Portable Installer" hits the point - as your tool does not install Autohotkey but rather activate previously installed versions. Maybe "AHK Switcher" or something similar might be a better choice ...
TheArkive wrote:
17 Mar 2020, 06:40

Code: Select all

myAHKroot_folder\
             ...\a_version_of_AHK
             ...\another_version_of_AHK
             ...\ect
What's the content of the subfolders \a_version_of_AHK, \another_version_of_AHK? Simply the contents of the AutoHotkey-Installation ZIP-Files?

Doing so (just putting the contents of AutoHotkey-Installation ZIP-Files (1.1.32, 2.0 a108) in Subfolders), I get the following error:

Code: Select all

---------------------------
AHK Portable Installer U64.exe
---------------------------
Error:  This value of type "String" has no property named "__Item".

	Line#
--->	321: oCtl.Add("",outProps["File description"],outProps["Product version"],outProps["Name"],A_LoopFileFullPath)

The current thread will exit.
---------------------------
OK   
---------------------------

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:01
by TheArkive
@hoppfrosch
Are you running the script? Or the EXE? I'd recommend the EXE.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:04
by TheArkive
@hoppfrosch
My bad, i see, looks like I packaged something not quite right. That error doesn't mean that AHK needs to be installed. It means I'm not using the settings array properly. Or you the libraries aren't being found properly.

EDIT: This is supposed to be a stand-alone program, with no need to have AHK pre-installed.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:15
by hoppfrosch
As you see in the error message above, I used your precompiled AHK Portable Installer U64.exe - not the script (latest verion 1.5, just downloaded from github)

I don't mean I need a preinstalled Autohotkey to use your script - i mean, your program requires that several Autohotkey versions already have to be on my system in order to be able to switch between the "preinstalled" versions.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:17
by TheArkive
@hoppfrosch
That's very odd, I just downloaded the release and tried it. Last week I also setup 2 PCs with this tool, and did not have AHK installed.

Can you walk me through what you did to get that error?

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:28
by hoppfrosch
What i did:

1.) Created a folder structure

Code: Select all

c:\Usr\Programme\AHK\
   ...\AutoHotkey_1.1.32.00
   ...\AutoHotkey_2.0-a108
2.) Unzipped AutoHotkey_1.1.32.00.zip/ahkdll-v2-release-master_2.0-a108-a2fa0498.zip into the corresponding subfolder

3.) Unzipped the freshly downloaded "AHK.Portable.Installer.v1.5.zip" to a new folder

4.) Started "AHK Portable Installer U64.exe"

5.) Selected "c:\Usr\Programme\AHK\" as Base folder from within "AHK Portable Installer U64.exe"

6.) Pressed OK .... and the error above occurs ...


-----
Note: I do have (another) AutoHotkey.exe (Version 2.0 a108) within my PATH environment ...

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:38
by TheArkive
hoppfrosch wrote:
17 Mar 2020, 07:28
2.) Unzipped AutoHotkey_1.1.32.00.zip/ahkdll-v2-release-master_2.0-a108-a2fa0498.zip into the corresponding subfolder

Ok so you are using AutoHotkey_H as your AHK v2? Where did you download the ahkdll-v2 master from? I've seen (i think) 2 different users on GitHub post compiled versions of AutoHotkey_H

AutoHotkey_H has been difficult to integrate into this program for a few different reasons. But if users give me feedback, I'll keep working to make it better.

I'm guessing that one of your AHK versions doesn't have version metadata. So I'll have to make sure if this data doesn't exist then it must use the folder to get version info.

EDIT: @hoppfrosch I'll have to try having AutoHotkey.exe in the PATH environment variable.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:42
by hoppfrosch
Ooops --- no, my mistake (copied the filename from my archive ...). I did NOT unzip ahkdll-v2-release-master_2.0-a108-a2fa0498.zip but I unzipped AutoHotkey_2.0-a108-a2fa0498.zip

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:46
by TheArkive
hoppfrosch wrote:
17 Mar 2020, 07:42
Ooops --- no, my mistake (copied the filename from my archive ...). I did NOT unzip ahkdll-v2-release-master_2.0-a108-a2fa0498.zip but I unzipped AutoHotkey_2.0-a108-a2fa0498.zip
Ok I'll try adding an AHK exe in the %PATH% var, see if that recreates the error.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:50
by hoppfrosch
TheArkive wrote:
17 Mar 2020, 07:38
I'm guessing that one of your AHK versions doesn't have version metadata. So I'll have to make sure if this data doesn't exist then it must use the folder to get version info.
Just checked properties of all Autohotkey.EXEs in the unzipped folders (AutoHotkeyA32.exe, AutoHotkeyU32.exe, AutoHotkeyU64.exe etc.) - all of them seem do have metadata "productname", "productversion", "description" ...

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 07:55
by TheArkive
@hoppfrosch
Hm, ok, try pointing the base folder to an empty folder. Shouldn't give errors. Start with that.

Then try just AHK v1 in the base folder, then just AHK v2 ... let me know what happens.

Re: AHK Portable Installer v1.5

Posted: 17 Mar 2020, 08:09
by hoppfrosch
I tried several variations - no one works.

Most Basic version:

1.) EMPTY base folder
2.) Sarted "AHK Portable Installer U64.exe"
3.) Added empty basefolder to settings ----> Everything's fine
4.) Closed ""AHK Portable Installer U64.exe"
5.) Created subfolder "AutoHotkey_1.1.32.00" within Basefolder
6.) Unzipped ONLY AutoHotkeyA32.exe from "AutoHotkey_1.1.32.00.zip" into basefolder\AutoHotkey_1.1.32.00 (no other files extracted from ZIP file)
7.) Restarted "AHK Portable Installer U64.exe"
8.) Error occurs!