wixl: Missing support for <Condition> element inside <Component>
It's not possible to make a component installation optional, because Component
elements don't support Condition
child elements.
A typical use case is that we want to offer the user Check-Box options to enable/disable Start Menu and Desktop shortcuts. We wish to make these Components conditional on a property value.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Name="BrowseTest"
Manufacturer="Test"
Id="32f61e92-2b76-4fe0-b6a3-659263ff609a"
UpgradeCode="7b96519b-0782-4cb6-bf18-8f169ad06fe1"
Language="1033"
Codepage="1252"
Version="1.0" >
<Package
Id="*"
Keywords="Installer"
Description="BrowseTest"
Comments="BrowseTest"
Manufacturer="Test"
InstallerVersion="100"
Languages="1033"
InstallScope="perMachine"
Compressed="yes"
SummaryCodepage="65001" />
<Media
Id="1"
Cabinet="archive.cab"
EmbedCab="yes"
DiskPrompt="CD-ROM" />
<Property Id="DiskPrompt" Value="Test" />
<Directory Id="TARGETDIR" Name="SourceDir" />
<Feature Id="Complete" Level="1" >
<ComponentGroupRef Id="TestComponentGroup" />
</Feature>
</Product>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="TestComponent" Guid="*">
<Condition>1</Condition>
<File Id="File" KeyPath="yes" Source="file.txt"/>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="TestComponentGroup">
<ComponentRef Id="TestComponent"/>
</ComponentGroup>
</Fragment>
</Wix>
$ wixl condition.wxs
** (wixl.exe:40532): ERROR **: 16:52:21.362: wix.vala:232: unhandled child Component node Condition
Edited by jhol