我发现有几个来源都提到要使用包含文件(.wxi)将WiX安装文件拆分成单独的部分(变量、组件等)。这对我来说很有道理,所以我将节点从.wxs文件中拿出来放在一个单独的文件中,但是当我尝试在Visual Studio 2008中编译项目时,每个都会出现一个错误,指出它是“在‘Product:{...}’部分中未解析的符号‘...’的引用”。
我尝试在我的Product.wxs文件中使用标记���但似乎会破坏架构验证。如果这是包含的方式,那么它应该放在哪里呢?
我手头上有以下文件:
我尝试在我的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>
我该如何在Visual Studio中构建它?脚本构建似乎更简单,但目前不是我的问题。