0
votes

I have a Wix Bundle that contains several packages. A couple of packages are mutually exclusive. By that I mean they are both included because one needs to be installed on 32-bit machines, the other on 64-bit machines. To solve that problem, I have defined a package group like this:

<Fragment>
  <PackageGroup Id="Drivers">
    <MsiPackage Id="Driversx64" InstallCondition="VersionNT64" SourceFile="SRC\drivers64.msi" DisplayInternalUI="no" Visible="no" ForcePerMachine="yes" EnableFeatureSelection="yes"/>
    <MsiPackage Id="Driversx86" InstallCondition="NOT VersionNT64" SourceFile=".SRC\drivers32.msi" DisplayInternalUI="no" Visible="no" ForcePerMachine="yes" EnableFeatureSelection="yes"/>
  </PackageGroup>
</Fragment>

And then, in the chain I just include the <PackageGroupRef Id="Drivers"/>

Things work as expected in that the engine correctly plans the installation based on the operating system.

The trouble I'm having is I want to display a list of packages that will be installed and I would like to:

  • determine from the custom bootstrapper whether a package is supposed to be visible to the UI or not, and maybe it's level
  • determine from the custom bootstrapper whether a package's InstallCondition evaluates to true of false

The bottom line though is I want to make sure my custom BA can obey what's declared in the bundle as far as what packages are allowed to be installed on the target system.

1

1 Answers

3
votes

During runtime, there will be a file called BootstrapperApplicationData.xml. This file will contain information about each package, including InstallCondition (not sure when it was added, may require v3.10.3). You'll be able to pass the value of each condition to the Engine's EvaluateCondition method to determine whether it is true or false.