The ComponentGroup element

The ComponentGroup element is used to group Component elements, which is helpful as it offers a way to reference all of your components with a single element. For example, when adding components to Feature (which you must always do), you could use ComponentRef elements directly. This is the technique we used in the previous chapter:

<Feature Id="ProductFeature"
         Title="Main Product"
         Level="1">
  <ComponentRef Id="CMP_MyProgramEXE" />
  <ComponentRef Id="CMP_AnotherFileDLL" />
</Feature>

However, by creating ComponentGroup, you can reference multiple components with a single ComponentGroupRef element. This is shown in the following snippet:

<Feature Id="ProductFeature"
         Title="Main Product"
         Level="1">
 <ComponentGroupRef Id="MyComponentGroup" ...

Get WiX 3.6: A Developer's Guide to Windows Installer XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.