1
我正在嘗試創建一個安裝程序,該安裝程序根據組合框的選擇安裝了一些組件,但似乎情況不起作用。我聲明瞭組合框,如下:WiX:基於組合框選擇安裝組件
...
<UI>
<ComboBox Property="Option">
<ListItem Text="Red" Value="red" />
<ListItem Text="Blue" Value="blue" />
<ListItem Text="Green" Value="green" />
</ComboBox>
...
我有一個特點:
<Feature Id="ProductFeature" Title="MyProgram" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
和組件集團聲明如下:
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="MainComponent">
<File Id="exe" Name="Main.exe" Source="Main.exe" />
</Component>
<Component Id="ComponentRed">
<Condition>Option=red</Condition>
<File Id="R" Name="config.txt" Source="red.txt" />
</Component>
<Component Id="ComponentBlue">
<File Id="B" Name="config.txt" Source="blue.txt" />
<Condition>Option=blue</Condition>
</Component>
<Component Id="ComponentGreen">
<File Id="G" Name="config.txt" Source="green.txt" />
<Condition>Option=green</Condition>
</Component>
</ComponentGroup>
謝謝,這解決了我的問題! –