我有兩個產品Product1 & Product2。 Product1使用p1.dll &產品2使用p2.dll。
我已經爲它們定義了獨立的ComponentGroups,但是在同一個wxs文件(Groups.wxs)中。
我已將這些組件組包含在單獨的功能F1 & F2(Feature.wxs)中。
然後爲Product1.wxs中的F1和Product2.wxs中的F2提供FeatureRef,如下所示。
在我的構建系統中,我在bin文件夾中有p1.dll或p2.dll。
當我構建Product1的安裝程序時,我的bin文件夾中只有p1.dll。
然而,當我建立產品1的安裝程序,它拋出 - 錯誤LGHT0103:系統無法找到文件「.. \ BIN \ p2.dll」如何有選擇地包含Wix Features
爲什麼要威克斯鏈接查找p2.dll當我Product1中沒有提供F2的FeatureRef?
我該如何解決這個問題?
Groups.wxs:
<ComponentGroup Id="G1">
<Component Id="C1" DiskId="1" Directory="BIN" Guid="xxxx">
<File Id="C1" Name="p1.dll" Source="..\bin\p1.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="G2">
<Component Id="C2" DiskId="1" Directory="BIN" Guid="yyyy">
<File Id="C2" Name="p2.dll" Source="..\bin\p2.dll" />
</Component>
</ComponentGroup>
Features.wxs:
<Feature Id="F1" Title="Feature1" Level="1">
<ComponentGroupRef Id="G1" />
</Feature>
<Feature Id="F2" Title="Feature2" Level="1">
<ComponentGroupRef Id="G2" />
</Feature>
Product1.wxs:
<FeatureRef Id="F1" />
Product2.wxs:
<FeatureRef Id="F2" />
Product1.wixproj
<ItemGroup>
<WixCode Include="$(WixCodeDir)\Groups.wxs" />
<WixCode Include="$(WixCodeDir)\Features.wxs" />
<WixCode Include="$(WixCodeDir)\Product1.wxs" />
</ItemGroup>
Product2.wixproj
<ItemGroup>
<WixCode Include="$(WixCodeDir)\Groups.wxs" />
<WixCode Include="$(WixCodeDir)\Features.wxs" />
<WixCode Include="$(WixCodeDir)\Product2.wxs" />
</ItemGroup>