AutoHotkey_L-Docs icon indicating copy to clipboard operation
AutoHotkey_L-Docs copied to clipboard

Update referenced registry keys for default editor update when run in "portable" mode

Open kdodia opened this issue 3 years ago • 2 comments

Hi folks, I initially ran AHK in the "portable" (uninstalled) manner, before installing it as normal.

I found that the script referenced in the documentation to update the registry key to set the default editor does not work in this case.

Instead, the HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\AutoHotkey.exe\shell\edit\command key must be created and set. (Thank you to @mike, I assume, for posting this over in the AHK Forums.

If this behavior can be reproduced and verified, I can submit a pull request to update the documentation to reference this alternate behavior.

kdodia avatar Feb 08 '22 21:02 kdodia

Due to the lack of VMs of different Windows versions and because I don't want to mess up my Windows 11 for this, I could only use Windows XP as a test environment, but it doesn't seem to work there. Looking through the forum discussions, it is noticeable that there is no reliable registry change that works for everyone. The reasons are unknown to me, but since it's quite cumbersome to test this, I'm not really interested in investigating it further.

What exactly do you want to change in the docs? At least it can be noted that the current example only works when using the installed version of AutoHotkey.

Ragnar-F avatar Feb 09 '22 12:02 Ragnar-F

Instead, the HKEY_CURRENT_USER\SOFTWARE\Classes\Applications\AutoHotkey.exe\shell\edit\command key must be created and set.

This occurs only if you used 'Open with' to associate .ahk files with AutoHotkey.exe. This creates an association in the current user's registry which overrides anything set by the installer, which is a recurring problem among users. The OS has measures in place to prevent applications from programmatically changing it, but I have worked out some countermeasures which I am implementing in the v2 installer.

For instance, see Edit context menu won't use SciTE.

The correct solution is to correctly associate .ahk files with the AutoHotkeyScript ProgID, which is usually done by deleting other extraneous keys that have been created as a result of using "Open with".

Lexikos avatar May 02 '22 07:05 Lexikos