See also:
Deleting and unregistering DLL files during install using Inno Setup
Inno Setup: How to automatically uninstall previous installed version?
In the [Files] section of my Inno Setup script, I have the line:
Source: {#InstallSource}\OldDll.dll; DestDir: {sys}; Flags: sharedfile regserver
This DLL is no longer used by the updated version of the application. What I'd like to do on installation of the new version is to reduce the shared file lock count for this DLL, and, if it's zero, unregister and delete it.
The simplest way to do this is to tell the users to uninstall the previous version of the application before updating, but this will mean that various configuration settings will also be deleted, and the users will have to re-enter them manually. Is it possible to automate the DLL unregistration/deletion process?