MSI Shared DLL reference count not decrement on upgrade
Hi All,
I have created an msi which places shared DLL file in to the folder "C:\program files\MY Product" it then created the relevant reference keys in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs
if I uninstall the msi the DLL are removed and the relevent keys deleted.
However if I upgrade the msi it increments the SharedDDLs reg key to 2 this means when I uninstall it doesn't remove the files
Can you please advise how to stop this so the DLL don't increment and the files are removed after uninstall
Thanks
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
jagadeish
9 years ago
Posted by:
anonymous_9363
9 years ago
Posted by:
EdT
9 years ago
Why are you using the shared DLL registry key at all? This is a legacy mechanism that was used before MSI technology was released, and MSI now tracks shared files based on the component GUID. If you must use the shared DLL registry key, then your upgrade should be written with a custom action that runs at the end of the upgrade which decrements the shared DLL count that the upgrade has incremented.
Posted by:
rad33k
9 years ago
The problem is that probably you have broken Windows Installer Best Practices - Organizing Applications into Components. Please make sure that Coponent ID of the shared DLL file in the newer package is exactly the same as in the older one. If these are unsynchronised it will behave like you described - DLL counter increments as Windows Installer assumes that two separate products have been installed (because of different Component Codes).