0

I am new to WiX. I have used the Heat tool to generate a wxs file based on a folder. Now how can I use the wxs file in the product.wxs without actually including the generated file to the solution. FYI, I know that I can reference the generated file using "ComponentGroupRef Id", but how can I specify the file path to the ComponentGroupRef?

Suresh
  • 69
  • 1
  • 8

2 Answers2

0

You don't have to specify the path to the file where that component group resides. You should basically do two things:

  • Make sure your heat-generated file is included in the compilation process. You can literally place it next to the other wxs files and let candle pick that folder
  • As you mentioned, reference that component group from your product.wxs with the help of ComponentGroupRef element
Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
0

Check the harvest element in the before build target.

<Target Name="BeforeBuild">
  <HarvestDirectory Include="$(SourceDir)">
    <DirectoryRefId>INSTALLDIR</DirectoryRefId>
    <ComponentGroupName>cmpMain</ComponentGroupName>
    <PreprocessorVariable>var.SourceDir</PreprocessorVariable>
    <SuppressUniqueIds>false</SuppressUniqueIds>
    <SuppressCom>true</SuppressCom>
    <SuppressRegistry>true</SuppressRegistry>
    <SuppressRootDirectory>true</SuppressRootDirectory>
    <KeepEmptyDirectories>false</KeepEmptyDirectories>
  <Transforms>DefaultTransform.xsl</Transforms>
</HarvestDirectory>

Make Component Group and reference to the generated file:

<ComponentGroup Id="ProductComponents" Directory="INSTALLDIR">
  <ComponentGroupRef Id="cmpMain" />
</ComponentGroup>

*You can skip this and move directly to reference in the feature table but I prefer to define all components in a different Components.wxs file.

And then include the component group in the feature table:

<Feature Id="Main" Title="Main" Level="1" ConfigurableDirectory="INSTALLDIR" >
  <ComponentGroupRef Id="ProductComponents" />
</Feature>
Arkady Sitnitsky
  • 1,846
  • 11
  • 22