4

I have a shell namespace extension, using a file system folder as its junction point (by creating a desktop.ini file with my extension's CLSID in the folder).

When upgrading to a new version of the extension, I would like to avoid restarting all processes that have the extension loaded (which is the suggested answer in How to unload C++ Shell Extension DLL properly), to provide a better user experience.

I've tried:

None of the above succeed in forcing explorer to load the new version of the extension.

I also tried registering a completely new CLSID for the new version of the extension and removing the registration for the old one. This mostly works, except when opening any previously existing shortcuts pointing to the folder. In that case, neither the old nor new extension are loaded, and the default shell folder is used to display the folder. I again tried SHChangeNotify, SHFlushSFCache, and SHGetSetFolderCustomSettings, and none of them fixed this issue with shortcuts.

I tested this on Windows 7 and Windows 10 Fall Creators.

  • Note NSE can be loaded by any process that opens a file dialog (notepad, word, you name it), so it's kind of impossible to do it right anyway. At least Explorer supports the restart API so it doesn't loose its state/windows, etc. – Simon Mourier Mar 27 '18 at 06:34
  • @SimonMourier Yes I realize that, all the more reason that I think there should be some way to get the shell to load a new version of the extension, regardless of the host process. – Jeremy Spiegel Mar 27 '18 at 17:10
  • You can't unload a dll from a process you don't own. The only way would be to implement your NSE as a proxy and write the real NSE as an out-of-process server, talking to the proxy. – Simon Mourier Mar 27 '18 at 18:03
  • @SimonMourier, it's ok if the old dll stays loaded, as long as the new dll is the one that is used when browsing into the file system folder junction point. That was what I was going for when trying out using a new CLSID for the new dll's shell folder. – Jeremy Spiegel Mar 27 '18 at 22:08

0 Answers0