[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' />
          </RegistryKey>
          <CreateFolder>
            <Permission GenericWrite="yes" GenericRead="yes" GenericAll="yes" User="Everyone" />
          </CreateFolder>
        </Component>
      </Directory>
    </DirectoryRef>
  </Fragment>

Fragment 2:

  <Fragment Id="CompanyMenuFolder">
    <Feature Id="CompanyMenuFolder">
      <ComponentRef Id="CompanyMenuFolder" />
    </Feature>
    <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' />
            </RegistryKey>
           <CreateFolder/>
            <RemoveFolder Id="RemoveCompanyMenuFolder" On="uninstall" />
          </Component>
        </Directory>
      </Directory>
    </DirectoryRef>
  </Fragment>

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