In my [Files]
section I have the following:
; Database password decryption (for PTS importing)
Source: "..\..\..\PTSTools\PTSTools\bin\x86\Release\PTSTools.dll"; DestDir: "{app}"; \
DestName: "PTSTools_x86.dll"; Flags: ignoreversion
Source: "..\..\..\PTSTools\PTSTools\bin\x64\Release\PTSTools.dll"; DestDir: "{app}"; \
DestName: "PTSTools_x64.dll"; Flags: ignoreversion; Check: IsWin64
In the [Run]
section I have:
Filename: "{dotnet40}\regasm.exe"; Parameters: "PTSTools_x86.dll /codebase"; \
WorkingDir: "{app}"; Flags: runhidden
Filename: "{dotnet4064}\regasm.exe"; Parameters: "PTSTools_x64.dll /codebase"; \
WorkingDir: "{app}"; Flags: runhidden; Check: IsWin64
Finally, in the [UninstallRun]
section I have:
Filename: {dotnet40}\regasm.exe; Parameters: /u PTSTools_x86.dll; WorkingDir: {app}; \
Flags: runhidden
Filename: {dotnet4064}\regasm.exe; Parameters: /u PTSTools_x64.dll; WorkingDir: {app}; \
Flags: runhidden; Check: IsWin64;
Now, in this version of my program I have consolidated the functionality of these two DLL files into another set of DLL files:
Source: "..\..\..\MSAToolsLibrary\MSAToolsLibrary\bin\x86\Release\MSAToolsLibrary.dll"; \
DestDir: "{app}"; DestName: "MSAToolsLibrary_x86.dll"; Flags: ignoreversion
Source: "..\..\..\MSAToolsLibrary\MSAToolsLibrary\bin\x64\Release\MSAToolsLibrary.dll"; \
DestDir: "{app}"; DestName: "MSAToolsLibrary_x64.dll"; Flags: ignoreversion; \
Check: IsWin64
As a result, the PTSTool
DLL files are no longer required. Now, I know I can simply delete them if they exist:
[InstallDelete]
Type: files; Name: "{app}\PTSTools_x64.dll"
Type: files; Name: "{app}\PTSTools_x86.dll"
But as far as I am aware this will not trigger the unregistering of the DLL files as is done in [UninstallRun]
.
How can I do this? Delete and unregister the DLL files (if they exist) during the install?