noelicus
noelicus

Reputation: 15055

Why does the WiX FileSearch and DetectCondition not work here?

I want WiX to install MSChart for .NET 3.5 first, which is the ExePackage. At the moment, it always installs it even if it's already there. I detect if it's already installed by looking in the destination directory in the 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>

Upvotes: 1

Views: 2756

Answers (1)

noelicus
noelicus

Reputation: 15055

The answer is to bring the Fragment into the bundle using a reference:

<bundle ... >
...
<util:FileSearchRef Id="SearchForMSChart"/>
...

As found in this related question about checking the registry.

Upvotes: 3

Related Questions