[wix-users] Duplicate Autogen GUID for components using registry keypath?

Rob Mensching rob at firegiant.com
Mon Aug 15 09:29:00 PDT 2016

They look like the same registry value, the default value under that registry key.

 Short replies here. Complete answers over there: http://www.firegiant.com/

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Foster, Richard - PAL
Sent: Monday, August 15, 2016 8:14 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Duplicate Autogen GUID for components using registry keypath?

Greetings all,

We have a common requirement in our installations for menu and data folders associated with the product. Currently, the definitions for these folders are being duplicated in product-specific files. I was hoping to be able to use bind-time variables to define these common items in a fragment (or set of fragments) that could be shared by all the products, but I'm running into a situation where WiX reports that there are duplicate GUID's for the associated components.

The two affected fragments look like this.

Fragment 1:

  <Fragment Id="ApplicationDataFolder">
    <DirectoryRef Id="CompanyAppDataFolderDir">
      <Directory Id="ProductAppDataFolderDir" Name="!(wix.product)">
        <Component Id="ApplicationDataFolder" Permanent="yes">
          <RegistryKey Root="HKCU" Key="SOFTWARE\!(wix.manufacturer)\!(wix.product) V!(bind.property.ProductVersion.Major).!(bind.property.ProductVersion.Minor).!(bind.property.ProductVersion.Build)">
            <RegistryValue Type="string" Value='ApplicationDataFolder_Component' KeyPath='yes' />
            <Permission GenericWrite="yes" GenericRead="yes" GenericAll="yes" User="Everyone" />

Fragment 2:

  <Fragment Id="CompanyMenuFolder">
    <Feature Id="CompanyMenuFolder">
      <ComponentRef Id="CompanyMenuFolder" />
    <DirectoryRef Id="TARGETDIR">
      <Directory Id="ProgramMenuFolder" ShortName="Programs">
        <Directory Id="CompanyMenuFolder" Name="!(wix.manufacturer)">
          <Component Id="CompanyMenuFolder">
            <RegistryKey Root="HKCU" Key="SOFTWARE\!(wix.manufacturer)\!(wix.product) V!(bind.property.ProductVersion.Major).!(bind.property.ProductVersion.Minor).!(bind.property.ProductVersion.Build)">
              <RegistryValue Type="string" Value='CompanyMenuFolder_Component' KeyPath='yes' />
            <RemoveFolder Id="RemoveCompanyMenuFolder" On="uninstall" />

As far as I can tell, the two keypaths should be different (while the RegistryKey is the same, the RegistryValue elements are not), and as a result I was expecting a different GUID. Instead, I'm getting the same GUID ( {4CA050B1-A167-594F-AD68-E169A0204531}). Any ideas what I'm doing wrong?

I did consider using another bind-time variable to hold the component lD, but that doesn't work either - bind-time variables appear not to be supported as component ID's, presumably because they don't immediately resolve to a valid GUID.

For now, I'll simply continue the practice of duplicating the items in each product, but I prefer to avoid such duplication. Is that possible?

Thanks in advance for any comments & suggestions, Regards, Richard

WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list