简体   繁体   中英

Wix Toolset. Unable to Delete Registry Keys on Uninstall

I wrote an Installer with Wix. Everything works but I can't delete Registry Keys on Uninstall; the log says

Disallowing uninstallation of component: {...} since another client exists

. The code is

    <ComponentGroup Id="RegistryGroup">
  <Component Id="_FB6B829B_467B_4EB8_B90C_9FF64097AD38" Guid="3FBC3951-B566-4EB9-842C-9FB70A8ECDE6" Transitive="no" Directory="TARGETDIR">
    <RegistryKey Root="HKCU" Key="Software" ForceCreateOnInstall="no" ForceDeleteOnUninstall="no" />
  </Component>
  <Component Id="_F47C127C_2EAC_4F0C_B742_03FFBCABE8AE" Guid="A5D5FF6A-1EEA-4941-9DC5-573FDCB595A5" Transitive="no" Directory="TARGETDIR">
    <RegistryKey Root="HKCU" Key="Software\[Manufacturer]" ForceCreateOnInstall="no" ForceDeleteOnUninstall="yes" />
  </Component>
  <Component Id="_684BCAC8_3162_4C7C_93A3_908CA1485F5C" Guid="92BF7699-68B1-44EE-BDE8-AF7E7CEB0EB0" Transitive="no" Directory="TARGETDIR">
    <RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" ForceCreateOnInstall="no" ForceDeleteOnUninstall="yes" />
  </Component>
  <Component Id="_FC3941D7_6617_4313_8257_5C3DE03A9838" Guid="7DCD2392-AC9A-4690-BC99-FEACAA774B08" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="ProductName" Value="[ProductName]" />
  </Component>
  <Component Id="_B86DABB3_7467_428B_9ECF_A6F59DB594E4" Guid="7A61E342-9764-4AA4-86A9-87C7A9C1DB09" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="ProductCode" Value="[ProductCode]" />
  </Component>
  <Component Id="_201EDD75_B6C7_4873_8AF9_06230F421B4F" Guid="52AE095B-FDEE-4923-B78A-F314BC26C6B6" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="Company" Value="[Manufacturer]" />
  </Component>
  <Component Id="_B76910AF_8752_45C2_98BF_80724406E3F9" Guid="81B183E7-67CA-4EF6-848E-55F8299B0A5C" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="ProductVersion" Value="[ProductVersion]" />
  </Component>
  <Component Id="_9BF1C162_A7A6_4B43_9D7C_6BD85C6C4F27" Guid="A571BA72-2216-49F0-AC28-E72C0866E9A3" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="Location" Value="[TARGETDIR]" />
  </Component>
  <Component Id="_B140E686_B49A_4BE4_93B3_DEEB07E5218E" Guid="F8996C3A-48EA-40DD-818B-5DC095B5F46F" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="Author" Value="[ARPCONTACT]" />
  </Component>
  <Component Id="_801F11AF_23B6_4C63_AEE7_05EB877E6543" Guid="0EC7189F-95BE-411E-BE48-A469032923F4" Transitive="no" Directory="TARGETDIR">
    <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Type="string" Name="Website" Value="[ARPHELPLINK]" />
  </Component>
</ComponentGroup>

What's wrong?

You have two or more installs with components that share the same GUIDs. You probably have authored upgrades of your install incorrectly in some way so every time you tested your installation you were adding more references to the GUIDs tied to these registry keys. You may also have more than one installation on your machine of your product.

You should have a bunch of registry entries under HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Installer\\S-1-5-18\\Components{GUID} Note that the GUID is going to be a different format due to endianness (I think) May help

I would suggest testing your installer in a clean environment preferably on a VM with a clean snapshot you can revert to in case you author a broken installer and are unable to install/uninstall/upgrade the installer and get your machine into a bad state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM