ComponentGroup element

The ComponentGroup element can be 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 a 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 a ComponentGroup, you can reference multiple components with a single ComponentGroupRef element. This is shown in the snippet:

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

Get WiX: 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.