Wix & Burn - Condition PackageGroupRef. Is it possible?

I have a bootstrapper project for my installer. The bootloader installs .NET, SQLExpress, IIS, and my application. I would like to install .NET4.5 if the OS is Windows Vista or higher and .NET4.0 is XP.

I use simple PackageGroupRefin element <Chain>using dll WixNetFxExtension:

<Chain>
  <PackageGroupRef Id="NetFx45Web"/>
  <PackageGroupRef Id="DotNetInstall"/>
</Chain>

Is there a way to insert a condition into PackageGroupRef? Or do I need to write my own .NET installation package?

Thank!

+4
source share
2 answers

I think I found a solution.

I created two more Wix Burn projects, one for installing .NET4.5 and one for installing .NET4.0. Something like that:

<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Bundle Name="Bootstrapper" Version="1.0.0.0" Manufacturer="VilmosNagy" UpgradeCode="844c755f-f02b-4dd3-8b9c-af2498f3128c">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
    <Chain>
      <PackageGroupRef Id="NetFx40Web"/>
    </Chain>
  </Bundle>
</Wix>

.NET4.5. .exe. , Packagegroup, .exe, Windows. - :

<PackageGroup Id="DotNetInstall">
  <ExePackage Id="Net45Installer"
              Name="Net45Installer.exe"
              InstallCommand="-q"
              InstallCondition="VersionNT &gt; v6.0"/>
  <ExePackage Id="Net40Installer"
              Name="Net40Installer.exe"
              InstallCommand="-q"
              InstallCondition="VersionNT &lt; v6.1"/>
</PackageGroup>

.NET4.0 XP. Win7, (), .

+3

3.9 , github 3.9 , , github 3.10 id .

3.10.. DetectCondition InstallCondition . github 3.10.2 netfx4.6

<WixVariable Id="NetFx45WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx45MinRelease)" Overridable="yes" />
<WixVariable Id="NetFx45WebInstallCondition" Value="" Overridable="yes" />
<WixVariable Id="NetFx45WebPackageDirectory" Value="redist\" Overridable="yes" />
0

Source: https://habr.com/ru/post/1547024/


All Articles