我希望 WiX 首先为 .NET 3.5 安装MSChart,即 ExePackage。目前,即使它已经存在,它也会始终安装它。我通过查看目标目录来检测它是否已经安装MSChartInstalled FileSearch
<Bundle ... etc.>
<Chain>
<ExePackage Id="mschart" SourceFile="MSChart.exe"
DetectCondition="MSChartInstalled"
Permanent="yes"
/>
<MsiPackage SourceFile="..\Setup\bin\Release\Setup.msi" />
</Chain>
</Bundle>
<Fragment>
<util:FileSearch
Id='SearchForMSChart'
Variable="MSChartInstalled"
Result="exists"
Path="[ProgramFilesFolder]Microsoft Chart Controls\Assemblies\System.Windows.Forms.DataVisualization.dll"
/>
</Fragment>