The error message says it all: it expects a ComponentGroup
-tag containing your components (containing e.g. files or registry keys). If you take a look at the example project that you linked in your question, the <ComponentGroupRef Id="DemoWebsiteIssConfiguration" />
-element references a ComponentGroup
with the name DemoWebsiteIssConfiguration
. You can find this in the file DemoWebsite.Setup\IISConfiguration.wxs
:
<ComponentGroup Id="DemoWebsiteIssConfiguration">
<ComponentRef Id="InstallWebsite" />
<ComponentRef Id="DemoWebsiteAppPool" />
</ComponentGroup>
It is a ComponentGroup
which contains two components or, in this case, references to two components. These components are defined above the ComponentGroup
-element in the same file.
Regarding the other ComponentGroupRef
with the id MyWebComponents
: The referenced ComponentGroup
is created dynamically during the build. You can take a look at the file DemoWebsite.Setup\setup.build
. This file is a MSBuild-file used to build the setup. It contains a target named Harvest
that invokes heat
, another tool in the WiX Toolset package. heat
will parse e.g. a directory and gather all the files contained within and put them in a ComponentGroup
that you can reference in your source file. I.e. you define a reference to a ComponentGroup
and then you can create the content of this dynamically. This way you don't have to bother if a file is added to or removed from the project, as heat
will gather them dynamically.
<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec
Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
The name of the dynamically created ComponentGroup
is defined with the parameter -cg
. you can invoke heat
with the parameter -?
for a short description of the possible parameters.