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" />
</Feature>
Try it out by adding a new CompontGroup
element to your .wxs
file. It can go anywhere inside the Product
element. Then, you have a choice...