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:
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL)
- SHFlushSFCache, which was suggested in Reload a namespace extension in explorer.exe that failed to load previously
- SHGetSetFolderCustomSettings with FCS_FORCEWRITE, as suggested in http://microsoft.public.platformsdk.shell.narkive.com/6r9JXG8r/explorer-in-vista-does-not-react-to-a-change-of-clsid-in-desktop-ini
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.