WinDepends icon indicating copy to clipboard operation
WinDepends copied to clipboard

Shell integration

Open AlexW-13 opened this issue 1 year ago • 2 comments

RemoveAssoc is never called - easy fix.

SetAssoc, use a quoted path, for when people have spaces in their file path:

try
        {
            using (var regKey = Registry.ClassesRoot.CreateSubKey(extKeyName, true))
            {
                if (regKey != null)
                {
                    // Set command value.
                    using (var subKey = regKey.CreateSubKey("command"))
                    {
                        subKey?.SetValue("", $"\"{Application.ExecutablePath}\" \"%1\"", RegistryValueKind.String);
                    }

                    // Set icon value.
                    regKey.SetValue("Icon", $"{Application.ExecutablePath}, 0", RegistryValueKind.String);
                }
            }
        }


AlexW-13 avatar Dec 06 '24 13:12 AlexW-13

@hfiref0x It seems like you forgot to include quotes around the %1 placeholder. The latest snapshot build is still creating "C:\WinDepends\bin\WinDepends.exe" %1 for the context menu, which doesn't work for files with spaces in their paths.

BTW: Working great on Windows 7. Thanks for this amazing tool.

i486 avatar Feb 15 '25 00:02 i486

@i486 You are right, thanks. This should be fixed now in the above mentioned commit.

hfiref0x avatar Feb 15 '25 03:02 hfiref0x