Improve version specific executable searching.#352
Improve version specific executable searching.#352EtorixDev wants to merge 3 commits intospyoungtech:mainfrom
Conversation
|
Thanks for suggesting. Are those install locations default behaviors for the AutoHotkey installer and is that documented somewhere? I think I also vaguely recall that the installer inserts a registry value for the location of the executable. If that registry key is known and stable, maybe that can be used. It may also be possible to infer the binary location if the program associated with |
|
The DOCS mention the default install location second hand a few times. From the V1 Docs it mentions this:
And
And related from the V2 Docs
So I believe my testing which showed that installing v1 then v2 causes v1 to install in the main folder and v2 in a subfolder, and installing v2 then v1 causes them each to have their own sub-folders is correct and default behavior, however I likely didn't handle the order of the executable as robustly as possible. As for the registry, I just opened up regedit and ctrl+f searched for "AutoHotkey" and found 3 entries for "ExecutablePath" that I think are used for the default "open with" settings? I also found in the AutoHotkey folder in the registry which has 2 subfolders "v1" and "v2" which have "Build" keys equaling either |
I was having some issues testing v1 behavior while working on another pull request because the library couldn't find my v1 installation. I completely uninstalled AutoHotkey twice and tested two install configurations to see how it behaved and rewrote the executable searching code to accommodate it.
The first time I installed v1 then v2. In this case, v1 installed into
C:\Program Files\AutoHotkeyand v2 installed intoC:\Program Files\AutoHotkey\v2.The second time I installed v2 then v1 (how I originally had it installed). In this case, v2 installed into
C:\Program Files\AutoHotkey\v2and v1 installed intoC:\Program Files\AutoHotkey\v1.1.37.02.So the rewritten code will search the top level install directory if v1 is selected, otherwise it will search for
v1...orv2...directories and then search there.I put all of the executables in a single list to save a line and an if statement but can split it if necessary.