2
我試圖讓條件組件工作。Wix組件條件
然而,它不工作,所以我很難過。
我有下面的代碼斑點:
的功能定義如下:
<Feature Id="MainFeature" Level="1" Title="!(loc.FEATURE.MAINFEATURE.TITLE)"
Description="!(loc.FEATURE.MAINFEATURE.DESCRIPTION)" Display="collapse">
<ComponentRef Id="MainExecutable" />
<ComponentRef Id="pmd" />
</Feature>
和組件但是這些文件永遠不會被定義爲
<Component Id="MainExecutable" Guid="*">
<Condition><![CDATA[(&MainFeature = 3) AND NOT (!MainFeature = 3)]]></Condition>
<File Id="MainExecutableFile" Name="SampleApp.exe"
Source="..\ProductBuild\sampleFile.txt" KeyPath="yes">
<Shortcut Id="MainExecutableStartMenu" Directory="ProgramMenuDir"
Name="!(loc.APPNAME)" WorkingDirectory="INSTALLDIR"
Icon="icon.ico" IconIndex="0" Advertise="yes"/>
<Shortcut Id="MainExecutableDesktop" Directory="DesktopFolder"
Name="!(loc.APPNAME)" WorkingDirectory="INSTALLDIR"
Icon="icon.ico" IconIndex="0" Advertise="yes" />
</File>
</Component>
安裝!
我打破了一些細節:http://www.joyofsetup.com/2008/04/09/feature-states-in-component-conditions/ – 2013-03-28 03:06:35
搶 - 加!正如我以爲它沒有做預期的事情...... 上面的例子是非常人爲提供一個非常簡單的用例。 我想根據組件是否安裝來安裝快捷方式,但是我想將所有快捷方式組合在一起,以便稍後讓生活更輕鬆....沒關係。
@Bob - 這可能是我在試圖找出爲什麼它不工作時找不到的唯一博客!它擊中了頭部 - 文檔充其量是誤導性的! – Dreaddan 2013-03-28 10:54:46
是的,聽起來像是「不這樣做」的情況。 ;)希望你找到一個優雅的解決方案,仍然適用於Windows安裝程序。 – 2013-03-28 12:26:04