Quick Fix: I have added this summary section at the top, but please read the below details sections as well. You are experiencing the common problem
of messed up component reference counting, and this is
causing these upgrade problems you are seeing. Component GUIDs are to
remain stable across releases as long as the key path does not change
(and it never should change - if it does then you need a new component
GUID - explanation below).
Early REP: Rather than fixing the real problem, there might be a way to deal with it that is less than ideal, and that is to use
"Early REP
" as we call it. Essentially you move
RemoveExistingProducts
in the InstallExecuteSequence
before InstallInitialize
. This will fully uninstall the old
version and then install the new one with all its files (generally) -
without interference. You decouple the new version from past sins. This can be done using Orca or an equivalent free tool (bottom) to hotfix your
compiled MSI (change sequence number in the InstallExecuteSequence
table) or it can be done in your source files - whichever tool
you are using.
Component Reference Counting: Erroneous component GUIDs and thereby reference counting for MSI components is a very bad thing - it has to be said. The component / key path concept
is at the heart of much of MSI itself - how it deals with file updates and maintenance and reference counting. The concept is essentially that for every absolute key-path there is supposed to be a single component GUID, shared by all packages targeting that location
. There are some more details here: Change my component GUID in wix?
WiX Auto-component GUIDs: If you are using WiX
(which we don't know if you do), then I would propose that you use WiX's auto-GUID concept
whereby a component GUID is calculated based on the installation key path as opposed to being hard coded in your WiX source (or generated by your build process). This WiX algorithm will take care of reference counting in an "auto-magic" fashion.
This answer tries to explain the rationale behind WiX auto-component GUIDs and how it can benefit you: Syntax for guids in WIX? Not all installation locations allow component GUIDs to be auto-generated, but for the most part it is a comprehensive "auto-magic".
Code Sample: When using auto-component GUIDs you do not specify a GUID in your source:
<!-- Sample guid below, do not copy paste -->
<Component Id="File.dll" Guid="{12345678-1234-1234-1234-123456789ABC}">
<File Id="File.dll" Name="File.dll" KeyPath="yes" Source="..\File.dll" />
</Component>
versus auto-component GUID:
<Component>
<File Source="..\File.dll" />
</Component>