我遇到過幾個消息來源,指出使用包含文件(.wxi)將WiX安裝文件拆分爲單獨的部分(變量,組件等)。對我來說非常有意義,所以我將<組件>組件從.wxs文件中取出並放入單獨的文件中,但是當我嘗試在Visual Studio 2008中編譯項目時,每個<ComponentRef>都會收到錯誤聲明它是「產品:{...}'部分中的」未解析的符號引用...「的引用。在Visual Studio WiX項目中使用WXI文件
我試過使用<?include「Filename」? >標籤在我的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?編寫腳本似乎更簡單,但不是我的問題。
@sascha在這裏有正確的建議。上面的系統中不需要包含任何內容。這是蠟燭/光的力量。 – 2009-04-30 14:48:32