<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->


<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <!--
        .NET Framework installation state properties

        Official documentation can be found at the following location:

           .NET Framework 4.5/4.5.1 - http://msdn.microsoft.com/en-us/library/5a4x27ek.aspx, http://msdn.microsoft.com/en-us/library/ee942965(v=VS.110).aspx
    -->

  <?define NetFx451MinRelease = 378675 ?>
  <?define NetFx451WebLink = http://go.microsoft.com/fwlink/?LinkId=322115 ?>
  <?define NetFx451RedistLink = http://go.microsoft.com/fwlink/?LinkId=322116 ?>
  <?define NetFx451EulaLink = http://wixtoolset.org/licenses/netfx451 ?>

  <Fragment>
    <PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
    <Property Id="WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED" Secure="yes" />
    <SetProperty Id="WIX_IS_NETFRAMEWORK_451_OR_LATER_INSTALLED" Value="1" After="AppSearch">
      WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx451MinRelease)"
    </SetProperty>
  </Fragment>

  <Fragment>
    <util:RegistrySearchRef Id="NETFRAMEWORK45"/>

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx451Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx451EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx451WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx451MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx451WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx451WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx451Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullWebLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullWebLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullWebLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx451WebDetectCondition)"
          InstallCondition="!(wix.NetFx451WebInstallCondition)"
          Id="NetFx451Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx451WebLink)"
          LogPathVariable="NetFx451FullWebLog"
          Compressed="no"
          Name="!(wix.NetFx451WebPackageDirectory)NDP451-KB2859818-Web.exe">
        <RemotePayload
            Size="1021432"
            Version="4.5.50938.18408"
            ProductName="Microsoft .NET Framework 4.5.1"
            Description="Microsoft .NET Framework 4.5.1 Setup"
            CertificatePublicKey="A260A870BE1145ED71E2BB5AA19463A4FE9DCC41"
            CertificateThumbprint="108E2BA23632620C427C570B6D9DB51AC31387FE"
            Hash="4CBEA1E408DB5B423E130931B9478972E6798431" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

  <Fragment>
    <util:RegistrySearchRef Id="NETFRAMEWORK45"/>

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx451Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx451EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx451RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx451MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx451RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx451RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx451Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx451FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx451RedistDetectCondition)"
          InstallCondition="!(wix.NetFx451RedistInstallCondition)"
          Id="NetFx451Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx451RedistLink)"
          LogPathVariable="NetFx451FullLog"
          Compressed="no"
          Name="!(wix.NetFx451RedistPackageDirectory)NDP451-KB2858728-x86-x64-AllOS-ENU.exe">
        <RemotePayload
            Size="70087104"
            Version="4.5.50938.18408"
            ProductName="Microsoft .NET Framework 4.5.1"
            Description="Microsoft .NET Framework 4.5.1 Setup"
            CertificatePublicKey="A260A870BE1145ED71E2BB5AA19463A4FE9DCC41"
            CertificateThumbprint="108E2BA23632620C427C570B6D9DB51AC31387FE"
            Hash="5934DD101414BBC0B7F1EE2780D2FC8B9BEC5C4D" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>
