SciTE4AutoHotkey icon indicating copy to clipboard operation
SciTE4AutoHotkey copied to clipboard

3.1.0 sets itself as default to open AHK, as in double click

Open ArchemedIan opened this issue 2 years ago • 4 comments

updating to 3.1.0 sets itself as default to open AHK when you double click, and the "Edit Script" part of the right-click menu is completely gone

installing SciTE4AHK300601_Install.exe it works as expected, but upgrading and not checking the box also makes double-click open the script rather than run it, and edit script is gone again

ArchemedIan avatar Jun 21 '22 06:06 ArchemedIan

Can confirm deleting this key solves the issue:

HKEY_CLASSES_ROOT\.ahk\OpenWithProgids

made from this code

https://github.com/fincs/SciTE4AutoHotkey/blob/ab38760d9c6c0bb3bce4d692066dc7b68f9beec8/installer/setup.ahk#L319

ArchemedIan avatar Jun 21 '22 08:06 ArchemedIan

Open-with registration just puts the program in the Explorer "open with" menu. The default program kind-of changing is due to a Windows bug. (I say "kind-of" because the change somehow occurs without the appropriate registry values changing or icons updating.) The workaround is already implemented by 49c3fe55.

Removing the RegWrite line would prevent SciTE4AutoHotkey from appearing in the Open With menu, or in the editor settings GUI included with AutoHotkey v2-beta.4+ (unless it's already the default editor).

Lexikos avatar Jun 30 '22 08:06 Lexikos

hmm. deleting the key does not remove it from the "open with" menu for me.

ArchemedIan avatar Jun 30 '22 18:06 ArchemedIan

If you have only just installed SciTE for the first time and it does not write to the OpenWithProgIds key, it will not appear in the list of suggested apps in "open with", or the "open with" submenu in Windows 11's context menu.

There is no way for the system to know that a program can open a certain file type if the system has never seen the program before and the program hasn't registered as being capable of opening those files.

However, you are not just installing SciTE for the first time. Explorer also maintains its own record of programs that can be used for different file types, such as when you manually select a program. This is under a subkey of the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ahk

It is almost certainly listed here, so will appear in the menu regardless of whether it is registered elsewhere. This is of no use to a brand new user; they would generally have to manually browse to SciTE.exe at least once before Explorer would register it.

Lexikos avatar Jul 22 '22 08:07 Lexikos