title: Most reasonable strategy for upgrading/uninstalling a shell extension?
body: <p>I want to create an installer for a shell extension that is installed for current user only. I want both upgrade and uninstall to run as seamless as possible for the end user.</p>
  
  <p>The problem is that a loaded shell extension DLL can be unregistered but not deleted because it is locked by Explorer. The installer will then get stuck when it tries to delete the DLL. As the shell extension is installed for current user only I cannot leverage any "delete DLL on reboot" option that require admin privileges. I also cannot use a hard restart of explorer.exe as it may leave the computer in an unusable state for the end user: Often times with restart explorer is shut down but not started again.</p>
  
  <p>After looking into the DLLs of some other applications it seems some might be using rolling version numbers, for example <code>shell_ext_v5.dll</code>, <code>shell_ext_v6.dll</code>, etc. New versions get a new number so the old DLL files do not necessarily need to be deleted.</p>
  
  <p>If I go with this strategy:</p>
  
  <ul>
  <li>When reinstalling the current version I can leave DLL untouched, as it has not changed.</li>
  <li>When upgrading, a new DLL will be installed, and registry will point to the new version. The old DLL file will remain in the system albeit unused.</li>
  <li>When uninstalling the DLL file may be left undeleted if it is locked by Explorer.</li>
  </ul>
  
  <p>So the bad thing is that there will be leftover DLL files in the system. But the good thing is install/uninstall would never get stuck if the DLL is locked. What do you think? Is there yet an alternative?</p>