[11.50b3] Deleting association does not work

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

[11.50b3] Deleting association does not work

Post by *Flint »

For experimenting I associated ICO files with MS Paint. Now I'm trying to unassociate them.
1. I place the cursor on an ICO file in TC, call Files - Associate with...
2. In the dialog I can see the "ico" file extension pre-selected, with its active association . Then I either click Delete, or manually scroll and select the (none) line; press OK.
3. In the file panels nothing changes. When I double-click or press Enter on an ICO file (from either TC or Explorer), it still opens in MS Paint. When I open Associate With dialog again, it shows that ICO files are still associated with MS Paint.

Tested in TC 10.50b3 32- and 64-bit, WIndows 10 x64.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
petermad
Power Member
Power Member
Posts: 16099
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [11.50b3] Deleting association does not work

Post by *petermad »

I can confirm that I can neither delete the association for a file type nor change it via the Associate dialog - Tested under Windows 7 and 10.

But changing the association via the Associate dialog does have some effect, because if I right on the file and choose "Open with" -> "Choose another app..." ("Choose standard program" in Win 7) , then the program, that I associated with in TC is suggested as the default app.

Also in Windows 10 I experienced that if changing association via context menu -> "Open with" -> "Choose another app..." did not work (association stuck with some Metro App/Windows Store app), then if I first associate with TC's "Associate With" and thereafter with the context menu, then I could force Window to change association.

But by itself, without using the context menu afterwards, I cannot mak TC change the association.
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.50b3] Deleting association does not work

Post by *ghisler(Author) »

This is a Windows misfeature: It happens when the user has chosen "Always open with this app" in the Windows "Open with" dialog. This essentially blocks the change of the association for all programs except for the Windows "Open with" dialog. Microsoft added this because installers often changed associations without asking the user. It's impossible to bypass this misfeature.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: [11.50b3] Deleting association does not work

Post by *Flint »

I did not use Windows "Open with" function at all. It was an (almost) clean Windows 10 virtual machine where ICO files originally did not have any association. So I opened TC's dialog Associate With, and specified mspaint there to check how IconFromIcoFile works. After the experiments I decided to check something else and tried to unassociate them, using the same TC Associate With dialog, but it didn't work. No "Open with" was involved at any step.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.50b3] Deleting association does not work

Post by *ghisler(Author) »

Some file types have preset UserChoice values under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
which also have this effect. Please check this for the affected extension.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: [11.50b3] Deleting association does not work

Post by *Flint »

I'm testing in a virtual machine and have a snapshot of the original state before I started changing associations, so I reverted it, and here is how the registry key changes.

1. Originally, when there is no association, it looks like this:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ico]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ico\OpenWithList]
"a"="mspaint.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ico\OpenWithProgids]
"icofile"=hex(0):

2. Then I open Files - Associate With command in TC while having cursor on an ICO file. In the Associate dialog I can see the ico extension selected, and completely empty "Associate with" editbox. I click New type, and in the "Open file" dialog I select: C:\Windows\System32\mspaint.exe. Then I click OK in the Associate dialog. The registry key that you mentioned does not change at all. There are the same two sub-keys with exactly the same values in them. I exported the REG file, and it's completely identical to the previous one. I also ran the registryinfo tool that you gave me in another forum thread, and compared its output before and after the change. The only thing that changed was, adding HKEY_CLASSES_ROOT\icofile\shell with open\command subkeys with the command to launch mspaint. Oh, and the default value of the HKEY_CLASSES_ROOT\icofile changed from "Icon" to "ico file".

3. Now I open Files - Associate With again, when having cursor on an ICO file. In the Associate dialog, I see ico pre-selected, and Associate with editbox has the text:

Code: Select all

ico file (C:\Windows\System32\mspaint.exe "%1")
I click Delete, the text changes to "(none)". Then I press OK. Again, absolutely nothing changes in the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ico. However, in the registryinfo tool output I can see quite a few changes: TC removes a sub-key from HKEY_CLASSES_ROOT\.ico\OpenWithProgids, and the same-named progID key from HKEY_CLASSES_ROOT. But it leaves the HKEY_CLASSES_ROOT\icofile\shell completely intact, with its mspaint association. And ICO files continue to be opened by MS Paint.

Here are the info dumps after each of the step listed above:
Archive with registryinfo dumps and REG files
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [11.50b3] Deleting association does not work

Post by *ghisler(Author) »

Sorry, as soon as there is an entry in FileExts, you cannot assign .ico to a different type, or delete the type. You can only edit the internals of that type.

Moderator message from: ghisler(Author) » 2024-10-31, 09:07 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
User avatar
j7n
Member
Member
Posts: 194
Joined: 2005-08-07, 21:56 UTC

Re: [11.50b3] Deleting association does not work

Post by *j7n »

The OpenWith feature existed in previous versions of Windows, and it was as confusing. Earlier in Win98 OpenWith would create a normal association in the same scheme under HKCR (ext_auto_file), but that changed in WinXP. It seems that Windows 2022/10 now forces OpenWith every time the first option from shell commands is executed, which then records the current ProgId into UserChoice.

The list of file extensions protected by a secret hash is limited. I found it curious that you could freely change EXE, DLL and REG among others. But common picture and multimedia files are protected:

.3g2 .3gp .3gp2 .3gpp .aac .adt .adts .avi .bmp .dib .flac .gif .htm .html .jfif .jpe .jpeg .jpg .m2t .m2ts .m3u .m4a .m4v .mkv .mod .mov .MP2 .mp3 .mp4 .mp4v .mpa .MPE .mpeg .mpg .mpv2 .mts .pdf .png .tif .tiff .TS .TTS .txt .url .wav .website .wm .wma .wmv .WPL http https microsoft-edge microsoft-edge-holographic ms-xbl-3d8b930f

The dialog seems confusingly designed by someone who didn't give it much thought. If you have multiple commands on the context menu, you can use them apart from the first without invoking this dialog (for example, open in regedit, open in notepad, etc.). When the dialog shows, it asks if you want to use this "app," which is actually the first shell command. But the ProgId can have many applications, or the current and previous ProgId can reference the same executable. If the clicked executable doesn't exist, the same dialog pops up (let's say you picked notepad which doesn't exist, and it asks whether you want to keep using regedit). It is ugly in Metro style.

On my system I have deleted OEMDefaultAssociations.dll and OEMDefaultAssociations.xml, which stops the protection with the secret hash. In the registry I made permissions inheritable for all children of HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts because there is a Deny permission for Administrator for the protected extensions. If the DLL is left alone, the Deny permission will come back. Then I wipe out all keys under it. On even newer versions of Windows there is a new Driver called ucpd.sys, which must also be stopped and removed.

I find it deeply troubling when my computer says to me that access is denied. Setting up associations takes a long time. I copy them over from another computer through remote registry.
#148174 Personal license
Running Total Commander v8.52a
Post Reply