Shell Extension Uninstall
Hello,

I would like to know the best way to upgrade/uninstall a shell extension. Simply unregistering is not enough as Explorer keeps the file locked for a certain amount of time. I also saw one piece of code that restarts the Shell but this is not very elegant because all the Startup Items are relaunched and this causes a mess not counting the disappearing and reappearing of the task bar...

The method I have been using for the last year or so works but I would like to have something more simple. For instance an upgrade is done like this: my installer copies the .dll to a .tmp file then unregisters the .dll and tries to delete the .dll file. It the deletion is successful then the .tmp is renamed to .dll and is registered: everything is fine. If the deletion fails then my installer creates a .bat file that deletes the .dll, renames the .tmp, registers the dll and deletes itself (this is why it is a .bat file: a .bat can delete itself while running, a .exe can't). Then this .bat file is registered in the RunOnce section to be executed at the next reboot. Uninstallation follows the same kind of process.

As you see this is kind of complex... I have been looking on the web for other way to do this but did not find any info. So anyone has something on this topic?? Before anyone posts it, the procedure for a regular DLL does NOT work for a shell extension...

Thanks
mynab