l33t
l33t

Reputation: 19937

Components in side-by-side installations not uninstalling correctly

Using Wix 3.11 and Visual Studio 2017. My Setup Bundle is built two times with conditional flags altering the UpgradeCode to allow for two brands that can co-exist (Product Id is auto-generated). Thus, I want to be able to install and/or uninstall Brand A and Brand B without causing issues for any of the two. They are considered two different installations. Still, I want to keep my Wix code clean and simple.

This scenario works:

  1. Install Brand A.
  2. Uninstall Brand A.

This scenario does not work:

  1. Install Brand A.
  2. Install Brand B.
  3. Uninstall Brand A. Entry "A" is gone from Control Panel, but files are left untouched.

I can see that important values in the Registry are still there.

<DirectoryRef Id="INSTALLLOCATION">
  <Component Id="MyExecutables" Guid="12345678-ABCD-1234-5678-111122223333" Win64="$(var.Win64)">
        <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\$(var.Brand)\Uninstall" Name="InstalledSoftware" Value="1" Type="integer" KeyPath="yes" />
  </Component>
</DirectoryRef>

As you can see, the Key is different for different brands, but the Guid is the same! I believe this has something to do with it. Maybe I need different guids for the different brands?

Q: What is the best way of solving this issue?

Upvotes: 0

Views: 37

Answers (1)

Wix requires each component to have its own unique GUID even if you have multiple components doing the exact same thing. So make sure that your components do not share the same GUID. You can easily grab GUID's here.

Upvotes: 1

Related Questions