I have written quite a complex Wix V3 project containing over 4000 files. I want to split the .wxs file into several smaller .wxs files linked together to form the one project, but I can't see how to actually get the main file (where the Product definition is) to connect with other components that are in the other files.
So for example my main Product file starts like this:
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="112eb09c-6346-4965-b98b-498571db45ac" Name="xxx xxx xxx" Language="1033" Version="$(var.ProductVersion)" Manufacturer="EMS" UpgradeCode="8fdd856c-028d-4a66-b51a- 10c83947a62d">
...
</Product>
and the next .wxs file goes like this
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define EMS Config Tool_TargetDir=$(var.EMS Config Tool.TargetDir)?>
<Fragment>
<Feature Id="ProductFeature" Title="xxx xxx xxx Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="INSTALLDIR_files" />
<ComponentGroupRef Id="app.publish_files" />
etc.
How do I tell the Product file to build in the Feature "ProductFeature" ?
It all complies ok, and if I put "mistakes" in the second file the compiler picks them up and flags them, but running the .msi file created, none of the "ComponentGroupRefs are being called and the none of the files get installed.
Is it the case that everything needs to be in just the one file, or am I missing something obvious?
The content of a
<Fragment>is only included if something in the fragment is referenced. This is a very powerful feature of the WiX Toolset.To get what you want, add a
<FeatureRef Id='ProductFeature' />under your<Product/>element.