1

I want to use Inno Setup to create an installation file for a shell extension. The problem is if I want to reinstall or uninstall the shell extension the setup may fail if the DLL is loaded by Explorer and cannot be deleted.

The shell extension will be installed for current user only, which means I cannot rely on Inno Setup's restartreplace or similar procedures that replace or delete DLL on reboot but require admin privileges.

(Old question:) The only idea I have is somehow running regsvr32 /u {app}\my_extension.dll in both install and uninstall before the DLL is deleted. At least when run from prompt this command never fails to unload and unregister a DLL even if it is loaded by Explorer, which is why I would like to use it with Inno Setup. Is there a way to run the command?

Edit: Not even unregistering the DLL will get Explorer to release it. I still need to find another way to release the DLL so it can be deleted.

Mr. Ran Dum
  • 151
  • 8
  • 1
    What about https://stackoverflow.com/q/28051357/850848 ? – Martin Prikryl May 01 '19 at 10:16
  • Though, Inno Setup should offer you to close Explorer to allow the DLL uninstallation. – Martin Prikryl May 01 '19 at 10:17
  • Thank you for comment! `Exec` seems to perfectly in [`BeforeInstall`](http://www.jrsoftware.org/ishelp/index.php?topic=scriptinstall)! Does anyone know if there is anything similar for uninstalling? – Mr. Ran Dum May 01 '19 at 15:24
  • I tried the closing Explorer option (`CloseApplications`), but it does not seem very reliable. User can choose not to exit explorer and get stuck in the installer. On the other hand sometimes explorer is shut down but not restarted. Altogether it seems very brittle. – Mr. Ran Dum May 01 '19 at 15:26
  • See https://stackoverflow.com/q/44446223/850848 – Martin Prikryl May 01 '19 at 16:04

0 Answers0