Author a Bundle Package Manifest

In order for any package to be consumable by another Bundle, a package definition needs to be authored that describes the package. This authoring can either go directly under the <Chain> element in the Bundle authoring or in a <Fragment> and can then be consumed by a Bundle by doing a <PackageGroupRef> inside <Chain>. The latter method enables sharing of the same package definition across different Bundle packages.

The WiX schema supports the following chained package types:

Here is an example of a package definition for an EXE package in a sharable fragment:

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <PackageGroup Id="MyPackage">
        <ExePackage 
          SourceFile="[sources]\packages\shared\MyPackage.exe"
          DetectCondition="ExeDetectedVariable"
          DownloadUrl="http://example.com/?mypackage.exe"
          InstallCommand="/q /ACTION=Install"
          RepairCommand="/q ACTION=Repair /hideconsole"
          UninstallCommand="/q ACTION=Uninstall /hideconsole" />
    </PackageGroup>
  </Fragment>
</Wix>

Now I can add install conditions to the package so that it only installs on x86 Windows XP and above. There are built-in variables that can be used to construct these condition statements. To leverage the built-in variables, simply add the highlighted section:

    <?xml version="1.0"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
      <Fragment>
        <PackageGroup Id="MyPackage">
            <ExePackage 
              SourceFile="[sources]\packages\shared\MyPackage.exe"
              DetectCondition="ExeDetectedVariable"
              DownloadUrl="http://example.com/?mypackage.exe"
              InstallCommand="/q /ACTION=Install"
              RepairCommand="/q ACTION=Repair /hideconsole"
              UninstallCommand="/q ACTION=Uninstall /hideconsole" 
              InstallCondition="NOT VersionNT64 AND VersionNT >= v5.1"/>
        </PackageGroup>
      </Fragment>
    </Wix>    

The VersionNT property takes up to a four-part version number ([Major].[Minor].[Build].[Revision]). For a list of major and minor versions of Windows Operating System, see Operating System Version.

You can also define your own variables and store search results in them. See Define Searches using Variables.