I came across several sources that talk about splitting the WiX installation file into separate parts (variables, components, etc.) using include files (.wxi). The idea is completely clear to me, so I took the <components> nodes from the .wxs file and put them in a separate file, but when I try to compile the project in Visual Studio 2008, I get an error for each <ComponentRef> stating that it is " Unauthorized reference to the symbol "..." in the section "Product: {...}".
I tried using <? include "Filename"? > tag in my Product.wxs file, but this seems to break the schema check. If this is a way to turn it on , where should it go?
The files that I have are as follows.
Product.wxs
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product ...> <Package .../> <Media .../> <Directory Id="TARGETDIR" Name="SourceDir"> </Directory> <Feature Id="MainProgram" Level="1"> <ComponentRef Id="ProductComponent" /> <Feature Id="ContextMenu" Level="2"> <ComponentRef Id="ContextMenuComponent" /> </Feature> </Feature> </Product> </Wix>
Components.wxi
<?xml version="1.0" encoding="utf-8"?> <Include> <Fragment> <Component Id="ProductComponent" ...> <File .../> </Component> <Component Id="ContextMenuComponent" ...> <RegistryKey .../> </Component> </Fragment> </Include>
How do I create it in Visual Studio? The build script seems simpler, but not a problem yet.
source share