Page 1 of 1

Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-08, 22:36 UTC
by Ilya
After changing default program for .sln files from VS to Rider icon changed not to Rider icon, but default exe icon instead. Digging registry I noticed that value for default icon for Rider starts with space:

Code: Select all

[HKEY_CLASSES_ROOT\Rider2018.2\DefaultIcon]
@=" C:\\Program Files\\JetBrains\\JetBrains Rider 2018.2.3\\bin\\rider64.exe,0"
Removing space fixed icon. And bringing space back breaks icon again.

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-08, 23:04 UTC
by ts4242
Confirmed! (tested with .png files)

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-09, 09:29 UTC
by HolgerK
Also TC may be modified to ignore leading spaces in absolute paths, the better way would be to report the wrong registry value to Jetbrains:
https://rider-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=97145

Regards
Holger

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-09, 10:11 UTC
by Horst.Epp
As HolgerK said report the problem to the originator of the problem.
It doesn't make sense to modify TC for such an error which is in no way a common or serious problem.

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-09, 12:20 UTC
by Ilya
Well, it's not a problem for Windows Explorer. It handles any number of leading and trailing white spaces. So it's rather confusing to see TC and Explorer behaves differently in the same situation. Also it seems like a common practice to ignore spaces in file and folder names for MS:

https://support.microsoft.com/en-us/help/2829981/support-for-whitespace-characters-in-file-and-folder-names-for-windows

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-09, 14:03 UTC
by HolgerK
Yes, one may create files or folders with leading white spaces also this is a very bad practice because some programs will fail to address these file as relative path if they trim the spaces away by default.
BUT: you can't create a drive letter starting with space.
This    is    not    a    valid    absolute    path!

Regards
Holger

Re: Not showing icon for file when DefaultIcon registry value starts with space.

Posted: 2018-12-09, 15:44 UTC
by Ilya
Yes, actually path with space(s) before device name is not fully qualified path. And pretty much anything will fail trying to address file using such path. It seems that Windows Explorer just trimming registry value.