New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetFxExtension should support .net 4.7 #5575

Open
jon-armen opened this Issue May 5, 2017 · 29 comments

Comments

Projects
None yet
@jon-armen

jon-armen commented May 5, 2017

Feature requests

Provide support for .net 4.7 via NetFxExtension, same as all prior versions of .net

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 May 8, 2017

This should work. I wrote this last week, based on the existing .Net 4.6.2 NetFxExtension.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx47MinRelease = 460798 ?>
  <?define NetFx47WebLink = http://go.microsoft.com/fwlink/?LinkId=825298 ?>
  <?define NetFx47RedistLink = http://go.microsoft.com/fwlink/?LinkId=825302 ?>
  <?define NetFx47EulaLink = http://referencesource.microsoft.com/license.html ?>

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

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx47Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx47EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx47WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx47MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx47WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx47WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx47Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx47WebDetectCondition)"
          InstallCondition="!(wix.NetFx47WebInstallCondition)"
          Id="NetFx47Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx47WebLink)"
          LogPathVariable="NetFx47FullLog"
          Compressed="no"
          Name="!(wix.NetFx47WebPackageDirectory)NDP47-KB3186500-Web.exe">
        <RemotePayload
          CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906"
          CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26"
          Description="Microsoft .NET Framework 4.7 Setup"
          Hash="B3A24DEB7A8D937FC0B5591CDCC2725BF4E1BDEA"
          ProductName="Microsoft .NET Framework 4.7"
          Size="1426720"
          Version="4.7.2053.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx47Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx47EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx47RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx47MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx47RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx47RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx47Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx47RedistDetectCondition)"
          InstallCondition="!(wix.NetFx47RedistInstallCondition)"
          Id="NetFx47Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx47RedistLink)"
          LogPathVariable="NetFx47FullLog"
          Compressed="no"
          Name="!(wix.NetFx47RedistPackageDirectory)NDP47-KB3186497-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906"
          CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26"
          Description="Microsoft .NET Framework 4.7 Setup"
          Hash="76054141A492BA307595250BDA05AD4E0694CDC3"
          ProductName="Microsoft .NET Framework 4.7"
          Size="61586744"
          Version="4.7.2053.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>
<Chain>            
      <PackageGroupRef Id="NetFx47Redist"/>
</Chain>

Mawe9999 commented May 8, 2017

This should work. I wrote this last week, based on the existing .Net 4.6.2 NetFxExtension.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx47MinRelease = 460798 ?>
  <?define NetFx47WebLink = http://go.microsoft.com/fwlink/?LinkId=825298 ?>
  <?define NetFx47RedistLink = http://go.microsoft.com/fwlink/?LinkId=825302 ?>
  <?define NetFx47EulaLink = http://referencesource.microsoft.com/license.html ?>

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

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx47Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx47EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx47WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx47MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx47WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx47WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx47Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx47WebDetectCondition)"
          InstallCondition="!(wix.NetFx47WebInstallCondition)"
          Id="NetFx47Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx47WebLink)"
          LogPathVariable="NetFx47FullLog"
          Compressed="no"
          Name="!(wix.NetFx47WebPackageDirectory)NDP47-KB3186500-Web.exe">
        <RemotePayload
          CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906"
          CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26"
          Description="Microsoft .NET Framework 4.7 Setup"
          Hash="B3A24DEB7A8D937FC0B5591CDCC2725BF4E1BDEA"
          ProductName="Microsoft .NET Framework 4.7"
          Size="1426720"
          Version="4.7.2053.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx47Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx47EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx47RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx47MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx47RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx47RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx47Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx47FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx47RedistDetectCondition)"
          InstallCondition="!(wix.NetFx47RedistInstallCondition)"
          Id="NetFx47Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx47RedistLink)"
          LogPathVariable="NetFx47FullLog"
          Compressed="no"
          Name="!(wix.NetFx47RedistPackageDirectory)NDP47-KB3186497-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906"
          CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26"
          Description="Microsoft .NET Framework 4.7 Setup"
          Hash="76054141A492BA307595250BDA05AD4E0694CDC3"
          ProductName="Microsoft .NET Framework 4.7"
          Size="61586744"
          Version="4.7.2053.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>
<Chain>            
      <PackageGroupRef Id="NetFx47Redist"/>
</Chain>
@Smurf-IV

This comment has been minimized.

Show comment
Hide comment
@Smurf-IV

Smurf-IV May 9, 2017

Until support comes from the extension
i.e. <PropertyRef Id="WIX_IS_NETFRAMEWORK_47_OR_LATER_INSTALLED" />

Then I am doing this
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="[ProductName] Requires .NET Framework 4.7 or later to be installed">
<![CDATA[Installed OR (NETFRAMEWORK45 AND NETFRAMEWORK45 >= "#460805")]]>
</Condition>

With the following to notify me when the extension changes so that I can use the documented type.
<Property Id="WIX_IS_NETFRAMEWORK_47_OR_LATER_INSTALLED" Value="0" />

Smurf-IV commented May 9, 2017

Until support comes from the extension
i.e. <PropertyRef Id="WIX_IS_NETFRAMEWORK_47_OR_LATER_INSTALLED" />

Then I am doing this
<PropertyRef Id="NETFRAMEWORK45" />
<Condition Message="[ProductName] Requires .NET Framework 4.7 or later to be installed">
<![CDATA[Installed OR (NETFRAMEWORK45 AND NETFRAMEWORK45 >= "#460805")]]>
</Condition>

With the following to notify me when the extension changes so that I can use the documented type.
<Property Id="WIX_IS_NETFRAMEWORK_47_OR_LATER_INSTALLED" Value="0" />

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 May 9, 2017

Thanks Smurf-IV for pointing that out, I forgot to change the NetFx47MinRelease variable. I've edited the code above.

The correct value for NetFx47MinRelease is 460798
https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

Mawe9999 commented May 9, 2017

Thanks Smurf-IV for pointing that out, I forgot to change the NetFx47MinRelease variable. I've edited the code above.

The correct value for NetFx47MinRelease is 460798
https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

@barnson barnson added this to the v4.x milestone May 9, 2017

@fiwonxg

This comment has been minimized.

Show comment
Hide comment
@fiwonxg

fiwonxg May 23, 2017

@Mawe9999 the web download is broken - the redirect links point to the webpages instead of executables, so the download fails.

fiwonxg commented May 23, 2017

@Mawe9999 the web download is broken - the redirect links point to the webpages instead of executables, so the download fails.

@fiwonxg

This comment has been minimized.

Show comment
Hide comment
@fiwonxg

fiwonxg May 23, 2017

Looks like instead of
http://go.microsoft.com/fwlink/?LinkId=825299
http://go.microsoft.com/fwlink/?LinkId=825303

it should be
http://go.microsoft.com/fwlink/?LinkId=825298
http://go.microsoft.com/fwlink/?LinkId=825302

fiwonxg commented May 23, 2017

Looks like instead of
http://go.microsoft.com/fwlink/?LinkId=825299
http://go.microsoft.com/fwlink/?LinkId=825303

it should be
http://go.microsoft.com/fwlink/?LinkId=825298
http://go.microsoft.com/fwlink/?LinkId=825302

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Jun 1, 2017

You are right. I've edited the code above.

Mawe9999 commented Jun 1, 2017

You are right. I've edited the code above.

@wstaelens

This comment has been minimized.

Show comment
Hide comment
@wstaelens

wstaelens Jul 13, 2017

yeah waiting for this!

wstaelens commented Jul 13, 2017

yeah waiting for this!

@todor-dk

This comment has been minimized.

Show comment
Hide comment
@todor-dk

todor-dk Jul 20, 2017

Please, give this issue a priority. Alternatively, write a work-around article on what to do in the meantime.

todor-dk commented Jul 20, 2017

Please, give this issue a priority. Alternatively, write a work-around article on what to do in the meantime.

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Jul 20, 2017

Just use the code I've posted above. Add a new wxs file to your setup project and copy & paste the code.

Mawe9999 commented Jul 20, 2017

Just use the code I've posted above. Add a new wxs file to your setup project and copy & paste the code.

@todor-dk

This comment has been minimized.

Show comment
Hide comment
@todor-dk

todor-dk Jul 21, 2017

Thank you. I didn't know that a project could contain several WXS files.

todor-dk commented Jul 21, 2017

Thank you. I didn't know that a project could contain several WXS files.

@todor-dk

This comment has been minimized.

Show comment
Hide comment
@todor-dk

todor-dk Jul 21, 2017

It works ... mostly. The .Net 4.7 requires some updates on Win 7 and 8 to be present before it will install (http://go.microsoft.com/fwlink/?LinkId=724315). If they are missing, the installer fails with a cryptic error. Digging in log files and trying to install manually, you will find the message: Blocking Issues: Setup cannot continue because a dependent update needs to be installed before you can install this product on Windows 7, Windows Server 2008 R2, Windows 8 or Windows Server 2012.

Is it possible to include those prerequisites so that NetFx47Web will install them automatically?

Alternatively, would you define a standard condition that checks for the .Net 4.7 prerequisites and that will prevent the installer from running until "this and that" has been installed?

Optionally, it is possible to report the problem from the underlying .Net package to the bootstrapper app, so that the end-user has a chance to install the prerequisites and fix the problem?

todor-dk commented Jul 21, 2017

It works ... mostly. The .Net 4.7 requires some updates on Win 7 and 8 to be present before it will install (http://go.microsoft.com/fwlink/?LinkId=724315). If they are missing, the installer fails with a cryptic error. Digging in log files and trying to install manually, you will find the message: Blocking Issues: Setup cannot continue because a dependent update needs to be installed before you can install this product on Windows 7, Windows Server 2008 R2, Windows 8 or Windows Server 2012.

Is it possible to include those prerequisites so that NetFx47Web will install them automatically?

Alternatively, would you define a standard condition that checks for the .Net 4.7 prerequisites and that will prevent the installer from running until "this and that" has been installed?

Optionally, it is possible to report the problem from the underlying .Net package to the bootstrapper app, so that the end-user has a chance to install the prerequisites and fix the problem?

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Jul 22, 2017

You could add those prerequisites to your bootstrapper, but I'm not sure how to detect whether the KB is installed or not.

Mawe9999 commented Jul 22, 2017

You could add those prerequisites to your bootstrapper, but I'm not sure how to detect whether the KB is installed or not.

@todor-dk

This comment has been minimized.

Show comment
Hide comment
@todor-dk

todor-dk Aug 1, 2017

OK. I will look into this. Do you know if there is a way to communicate the error messages from the MSI package to the bootstrapper app? In this way, we can tell the user what's wrong. We have our own bootstrapper app that we can customize.

todor-dk commented Aug 1, 2017

OK. I will look into this. Do you know if there is a way to communicate the error messages from the MSI package to the bootstrapper app? In this way, we can tell the user what's wrong. We have our own bootstrapper app that we can customize.

@softlion

This comment has been minimized.

Show comment
Hide comment
@softlion

softlion Oct 2, 2017

Info for missing update: d3dcompiler

https://support.microsoft.com/fr-fr/help/4020302/the-net-framework-4-7-installation-is-blocked-on-windows-7-windows-ser

For:
On Windows 7 SP1 x86
On Windows 7 SP1 or Windows Server 2008 R2 x64
On Windows Server 2012 x64

I've implemented this in a PackageGroup where NetFx47Web is installed (note: the conditions are not working):

  <MsuPackage
    Id="d3dcompiler64"
    Compressed="no"
    DetectCondition="((NOT VersionNT64) OR (VersionNT > v6.1))"
    DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=848158"
    KB="KB4019990"
    Name="redist\Windows6.1-KB4019990-x64.msu">
    <RemotePayload CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906" CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26" Description="Microsoft .NET Framework 4.7 prerequisite setup" Hash="35CC310E81EF23439BA0EC1F11D7B71DD34ADFE5" ProductName="Microsoft .NET Framework 4.7 prerequisite" Size="2873529" Version="1.0.0.0" />
  </MsuPackage>

  <!-- Windows 7 SP1 x86 -->
  <MsuPackage
    Id="d3dcompiler86"
    Compressed="no"
    DetectCondition="((VersionNT64) OR (VersionNT > v6.1))"
    DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=848159"
    KB="KB4019990"
    Name="redist\Windows6.1-KB4019990-x86.msu">
    <RemotePayload CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906" CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26" Description="Microsoft .NET Framework 4.7 prerequisite setup" Hash="1365FB557D5E5917CBF59B507EAC066AD89EA3F7" ProductName="Microsoft .NET Framework 4.7 prerequisite" Size="1424481" Version="1.0.0.0" />
  </MsuPackage>

softlion commented Oct 2, 2017

Info for missing update: d3dcompiler

https://support.microsoft.com/fr-fr/help/4020302/the-net-framework-4-7-installation-is-blocked-on-windows-7-windows-ser

For:
On Windows 7 SP1 x86
On Windows 7 SP1 or Windows Server 2008 R2 x64
On Windows Server 2012 x64

I've implemented this in a PackageGroup where NetFx47Web is installed (note: the conditions are not working):

  <MsuPackage
    Id="d3dcompiler64"
    Compressed="no"
    DetectCondition="((NOT VersionNT64) OR (VersionNT > v6.1))"
    DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=848158"
    KB="KB4019990"
    Name="redist\Windows6.1-KB4019990-x64.msu">
    <RemotePayload CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906" CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26" Description="Microsoft .NET Framework 4.7 prerequisite setup" Hash="35CC310E81EF23439BA0EC1F11D7B71DD34ADFE5" ProductName="Microsoft .NET Framework 4.7 prerequisite" Size="2873529" Version="1.0.0.0" />
  </MsuPackage>

  <!-- Windows 7 SP1 x86 -->
  <MsuPackage
    Id="d3dcompiler86"
    Compressed="no"
    DetectCondition="((VersionNT64) OR (VersionNT > v6.1))"
    DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=848159"
    KB="KB4019990"
    Name="redist\Windows6.1-KB4019990-x86.msu">
    <RemotePayload CertificatePublicKey="371DD003A37769487A2A89A5A9DDB3026451B906" CertificateThumbprint="98ED99A67886D020C564923B7DF25E9AC019DF26" Description="Microsoft .NET Framework 4.7 prerequisite setup" Hash="1365FB557D5E5917CBF59B507EAC066AD89EA3F7" ProductName="Microsoft .NET Framework 4.7 prerequisite" Size="1424481" Version="1.0.0.0" />
  </MsuPackage>
@KirilRusev

This comment has been minimized.

Show comment
Hide comment
@KirilRusev

KirilRusev Dec 4, 2017

We need standard support for .NET Framework 4.7.1

KirilRusev commented Dec 4, 2017

We need standard support for .NET Framework 4.7.1

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Dec 4, 2017

Use this for .Net 4.7.1 Support. Add a new wxs file to your bootstrapper and copy the code below.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx471MinRelease = 461308 ?>
  <?define NetFx471WebLink = http://go.microsoft.com/fwlink/?LinkId=852092 ?>
  <?define NetFx471RedistLink = http://go.microsoft.com/fwlink/?LinkId=852104 ?>
  <?define NetFx471EulaLink = http://referencesource.microsoft.com/license.html ?>

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

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx471Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx471EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx471WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx471MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx471WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx471WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx471Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx471WebDetectCondition)"
          InstallCondition="!(wix.NetFx471WebInstallCondition)"
          Id="NetFx471Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx471WebLink)"
          LogPathVariable="NetFx471FullLog"
          Compressed="no"
          Name="!(wix.NetFx471WebPackageDirectory)NDP471-KB4033344-Web.exe">
        <RemotePayload
          CertificatePublicKey="2ECAEC21B884B40A7C5FB141D2CBC4CDA4930752"
          CertificateThumbprint="49D59D86505D82942A076388693F4FB7B21254EE"
          Description="Microsoft .NET Framework 4.7.1 Setup"
          Hash="C0919415622D86C3D6AB19F0F92EA938788DB847"
          ProductName="Microsoft .NET Framework 4.7.1"
          Size="1434504"
          Version="4.7.2558.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx471Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx471EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx471RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx471MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx471RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx471RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx471Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx471RedistDetectCondition)"
          InstallCondition="!(wix.NetFx471RedistInstallCondition)"
          Id="NetFx471Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx471RedistLink)"
          LogPathVariable="NetFx471FullLog"
          Compressed="no"
          Name="!(wix.NetFx471RedistPackageDirectory)NDP471-KB4033342-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="2ECAEC21B884B40A7C5FB141D2CBC4CDA4930752"
          CertificateThumbprint="49D59D86505D82942A076388693F4FB7B21254EE"
          Description="Microsoft .NET Framework 4.7.1 Setup"
          Hash="5F0597CEADDBDF3BAD24CA6EBE142BD81C2DF713"
          ProductName="Microsoft .NET Framework 4.7.1"
          Size="68742112"
          Version="4.7.2558.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>

Usage:

<Chain>      
      <PackageGroupRef Id="NetFx471Redist"/>
</Chain>

Mawe9999 commented Dec 4, 2017

Use this for .Net 4.7.1 Support. Add a new wxs file to your bootstrapper and copy the code below.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx471MinRelease = 461308 ?>
  <?define NetFx471WebLink = http://go.microsoft.com/fwlink/?LinkId=852092 ?>
  <?define NetFx471RedistLink = http://go.microsoft.com/fwlink/?LinkId=852104 ?>
  <?define NetFx471EulaLink = http://referencesource.microsoft.com/license.html ?>

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

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx471Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx471EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx471WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx471MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx471WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx471WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx471Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx471WebDetectCondition)"
          InstallCondition="!(wix.NetFx471WebInstallCondition)"
          Id="NetFx471Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx471WebLink)"
          LogPathVariable="NetFx471FullLog"
          Compressed="no"
          Name="!(wix.NetFx471WebPackageDirectory)NDP471-KB4033344-Web.exe">
        <RemotePayload
          CertificatePublicKey="2ECAEC21B884B40A7C5FB141D2CBC4CDA4930752"
          CertificateThumbprint="49D59D86505D82942A076388693F4FB7B21254EE"
          Description="Microsoft .NET Framework 4.7.1 Setup"
          Hash="C0919415622D86C3D6AB19F0F92EA938788DB847"
          ProductName="Microsoft .NET Framework 4.7.1"
          Size="1434504"
          Version="4.7.2558.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx471Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx471EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx471RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx471MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx471RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx471RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx471Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx471FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx471RedistDetectCondition)"
          InstallCondition="!(wix.NetFx471RedistInstallCondition)"
          Id="NetFx471Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx471RedistLink)"
          LogPathVariable="NetFx471FullLog"
          Compressed="no"
          Name="!(wix.NetFx471RedistPackageDirectory)NDP471-KB4033342-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="2ECAEC21B884B40A7C5FB141D2CBC4CDA4930752"
          CertificateThumbprint="49D59D86505D82942A076388693F4FB7B21254EE"
          Description="Microsoft .NET Framework 4.7.1 Setup"
          Hash="5F0597CEADDBDF3BAD24CA6EBE142BD81C2DF713"
          ProductName="Microsoft .NET Framework 4.7.1"
          Size="68742112"
          Version="4.7.2558.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>

Usage:

<Chain>      
      <PackageGroupRef Id="NetFx471Redist"/>
</Chain>
@KirilRusev

This comment has been minimized.

Show comment
Hide comment
@KirilRusev

KirilRusev Dec 4, 2017

Hi @Mawe9999 , thank you. I've added the first part of the code in separate NetFx471Redist.wxs file, but when I try to reference it in my Product.wxs I get
"Unresolved reference to symbol 'Property:NetFx471Redist' in section 'Product:*'." like:

<PropertyRef Id="NetFx471Redist"/>
<Condition Message="You must install Microsoft .NET Framework 4.7.1 or higher.">
  <![CDATA[Installed OR NetFx471Redist]]>
</Condition>

Any idea why? Both wxs start with <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" ...

KirilRusev commented Dec 4, 2017

Hi @Mawe9999 , thank you. I've added the first part of the code in separate NetFx471Redist.wxs file, but when I try to reference it in my Product.wxs I get
"Unresolved reference to symbol 'Property:NetFx471Redist' in section 'Product:*'." like:

<PropertyRef Id="NetFx471Redist"/>
<Condition Message="You must install Microsoft .NET Framework 4.7.1 or higher.">
  <![CDATA[Installed OR NetFx471Redist]]>
</Condition>

Any idea why? Both wxs start with <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" ...

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Dec 4, 2017

@KirilRusev Did you create a bootstrapper project?

Your bundle.wxs should be something like this:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
   
  <Bundle Name="..."
          Version="..." 
          Manufacturer="..." 
          UpgradeCode="..." 
          >
   
    <Chain>      
      
      <!--Install .Net Framework 4.7.1-->
      <PackageGroupRef Id="NetFx471Redist"/>
                
      <!--Install Product-->
      <MsiPackage
        Id="Setup"   
        DisplayInternalUI="yes"
        Compressed="yes"
        SourceFile="..."
        Vital="yes">        
      </MsiPackage>     
                           
    </Chain>
  </Bundle>  
</Wix>

You might want to check out the documentation on how to create bundles:
http://wixtoolset.org/documentation/manual/v3/bundle/

Mawe9999 commented Dec 4, 2017

@KirilRusev Did you create a bootstrapper project?

Your bundle.wxs should be something like this:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
   
  <Bundle Name="..."
          Version="..." 
          Manufacturer="..." 
          UpgradeCode="..." 
          >
   
    <Chain>      
      
      <!--Install .Net Framework 4.7.1-->
      <PackageGroupRef Id="NetFx471Redist"/>
                
      <!--Install Product-->
      <MsiPackage
        Id="Setup"   
        DisplayInternalUI="yes"
        Compressed="yes"
        SourceFile="..."
        Vital="yes">        
      </MsiPackage>     
                           
    </Chain>
  </Bundle>  
</Wix>

You might want to check out the documentation on how to create bundles:
http://wixtoolset.org/documentation/manual/v3/bundle/

@cogwheel

This comment has been minimized.

Show comment
Hide comment
@cogwheel

cogwheel Feb 8, 2018

@Mawe9999 How is this new wxs file supposed to be referenced? Does it need to be added to the build script? Is just having the wxs file in the dir supposed to work?

cogwheel commented Feb 8, 2018

@Mawe9999 How is this new wxs file supposed to be referenced? Does it need to be added to the build script? Is just having the wxs file in the dir supposed to work?

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 Feb 9, 2018

@cogwheel If you are working with Visual Studio you can add the wxs file to your bootstrapper project and it should work without being referenced anywhere.

Mawe9999 commented Feb 9, 2018

@cogwheel If you are working with Visual Studio you can add the wxs file to your bootstrapper project and it should work without being referenced anywhere.

@cogwheel

This comment has been minimized.

Show comment
Hide comment
@cogwheel

cogwheel Feb 9, 2018

I joined a project that is using the command line Wix tools without a bootstrapper, so it wasn't that simple. I managed to figure it out though: just had to add the netfx471.wxs to the same candle & light commands as the bundle.wxs that I added.

cogwheel commented Feb 9, 2018

I joined a project that is using the command line Wix tools without a bootstrapper, so it wasn't that simple. I managed to figure it out though: just had to add the netfx471.wxs to the same candle & light commands as the bundle.wxs that I added.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 11, 2018

I haven't come across the missing dependency blocking the 4.7.1 install but I have been seeing a situation where burn thinks 4.7.1 failed but the netfx log says it just needs a reboot. Everything works after the reboot but the error message saying the bundle was failed to rollback looks bad to the user.

ghost commented Feb 11, 2018

I haven't come across the missing dependency blocking the 4.7.1 install but I have been seeing a situation where burn thinks 4.7.1 failed but the netfx log says it just needs a reboot. Everything works after the reboot but the error message saying the bundle was failed to rollback looks bad to the user.

@Mawe9999

This comment has been minimized.

Show comment
Hide comment
@Mawe9999

Mawe9999 May 3, 2018

If someone needs WIX support for .Net 4.7.2 use the following code.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1/4.7.2 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx472MinRelease = 461808 ?>
  <?define NetFx472WebLink = http://go.microsoft.com/fwlink/?LinkId=863262 ?>
  <?define NetFx472RedistLink = http://go.microsoft.com/fwlink/?LinkId=863265 ?>
  <?define NetFx472EulaLink = http://referencesource.microsoft.com/license.html ?>
  
  <Fragment>
    <PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
    <Property Id="WIX_IS_NETFRAMEWORK_472_OR_LATER_INSTALLED" Secure="yes" />
    <SetProperty Id="WIX_IS_NETFRAMEWORK_472_OR_LATER_INSTALLED" Value="1" After="AppSearch">
      WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx472MinRelease)"
    </SetProperty>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx472Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx472EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx472WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx472MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx472WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx472WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx472Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx472WebDetectCondition)"
          InstallCondition="!(wix.NetFx472WebInstallCondition)"
          Id="NetFx472Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx472WebLink)"
          LogPathVariable="NetFx472FullLog"
          Compressed="no"
          Name="!(wix.NetFx472WebPackageDirectory)NDP472-KB4054531-Web.exe">
        <RemotePayload
          CertificatePublicKey="C090C1A2CAFA9B967D9C87C7FE02F7C01FBDE4F2"
          CertificateThumbprint="5EAD300DC7E4D637948ECB0ED829A072BD152E17"
          Description="Microsoft .NET Framework 4.7.2 Setup"
          Hash="507ECDADC23A27C2283BA130A2AA51650E6BC05B"
          ProductName="Microsoft .NET Framework 4.7.2"
          Size="1447320"
          Version="4.7.3062.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx472Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx472EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx472RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx472MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx472RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx472RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx472Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx472RedistDetectCondition)"
          InstallCondition="!(wix.NetFx472RedistInstallCondition)"
          Id="NetFx472Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx472RedistLink)"
          LogPathVariable="NetFx472FullLog"
          Compressed="no"
          Name="!(wix.NetFx472RedistPackageDirectory)NDP472-KB4054530-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="C090C1A2CAFA9B967D9C87C7FE02F7C01FBDE4F2"
          CertificateThumbprint="5EAD300DC7E4D637948ECB0ED829A072BD152E17"
          Description="Microsoft .NET Framework 4.7.2 Setup"
          Hash="D3A416DC5FC75758D41B4C0158ACA69270D2A904"
          ProductName="Microsoft .NET Framework 4.7.2"
          Size="71607232"
          Version="4.7.3062.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>

Add the following code to your bundle

<Chain>
  <!--Install .Net Framework 4.7.2-->
  <PackageGroupRef Id="NetFx472Redist"/>
</Chain>

Mawe9999 commented May 3, 2018

If someone needs WIX support for .Net 4.7.2 use the following code.

<?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/4.5.2/4.6/4.6.1/4.6.2/4.7/4.7.1/4.7.2 - http://msdn.microsoft.com/en-us/library/w0x726c2(v=vs.110).aspx
    -->
  
  <?define NetFx472MinRelease = 461808 ?>
  <?define NetFx472WebLink = http://go.microsoft.com/fwlink/?LinkId=863262 ?>
  <?define NetFx472RedistLink = http://go.microsoft.com/fwlink/?LinkId=863265 ?>
  <?define NetFx472EulaLink = http://referencesource.microsoft.com/license.html ?>
  
  <Fragment>
    <PropertyRef Id="WIXNETFX4RELEASEINSTALLED" />
    <Property Id="WIX_IS_NETFRAMEWORK_472_OR_LATER_INSTALLED" Secure="yes" />
    <SetProperty Id="WIX_IS_NETFRAMEWORK_472_OR_LATER_INSTALLED" Value="1" After="AppSearch">
      WIXNETFX4RELEASEINSTALLED >= "#$(var.NetFx472MinRelease)"
    </SetProperty>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx472Web" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx472EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx472WebDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx472MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx472WebInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx472WebPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx472Web">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx472WebDetectCondition)"
          InstallCondition="!(wix.NetFx472WebInstallCondition)"
          Id="NetFx472Web"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx472WebLink)"
          LogPathVariable="NetFx472FullLog"
          Compressed="no"
          Name="!(wix.NetFx472WebPackageDirectory)NDP472-KB4054531-Web.exe">
        <RemotePayload
          CertificatePublicKey="C090C1A2CAFA9B967D9C87C7FE02F7C01FBDE4F2"
          CertificateThumbprint="5EAD300DC7E4D637948ECB0ED829A072BD152E17"
          Description="Microsoft .NET Framework 4.7.2 Setup"
          Hash="507ECDADC23A27C2283BA130A2AA51650E6BC05B"
          ProductName="Microsoft .NET Framework 4.7.2"
          Size="1447320"
          Version="4.7.3062.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>

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

    <WixVariable Id="WixMbaPrereqPackageId" Value="NetFx472Redist" />
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value="$(var.NetFx472EulaLink)" Overridable="yes" />
    <WixVariable Id="NetFx472RedistDetectCondition" Value="NETFRAMEWORK45 &gt;= $(var.NetFx472MinRelease)" Overridable="yes" />
    <WixVariable Id="NetFx472RedistInstallCondition" Value="" Overridable="yes" />
    <WixVariable Id="NetFx472RedistPackageDirectory" Value="redist\" Overridable="yes" />

    <PackageGroup Id="NetFx472Redist">
      <ExePackage
          InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx472FullLog].html&quot;"
          PerMachine="yes"
          DetectCondition="!(wix.NetFx472RedistDetectCondition)"
          InstallCondition="!(wix.NetFx472RedistInstallCondition)"
          Id="NetFx472Redist"
          Vital="yes"
          Permanent="yes"
          Protocol="netfx4"
          DownloadUrl="$(var.NetFx472RedistLink)"
          LogPathVariable="NetFx472FullLog"
          Compressed="no"
          Name="!(wix.NetFx472RedistPackageDirectory)NDP472-KB4054530-x86-x64-AllOS-ENU.exe">
        <RemotePayload
          CertificatePublicKey="C090C1A2CAFA9B967D9C87C7FE02F7C01FBDE4F2"
          CertificateThumbprint="5EAD300DC7E4D637948ECB0ED829A072BD152E17"
          Description="Microsoft .NET Framework 4.7.2 Setup"
          Hash="D3A416DC5FC75758D41B4C0158ACA69270D2A904"
          ProductName="Microsoft .NET Framework 4.7.2"
          Size="71607232"
          Version="4.7.3062.0" />
      </ExePackage>
    </PackageGroup>
  </Fragment>
</Wix>

Add the following code to your bundle

<Chain>
  <!--Install .Net Framework 4.7.2-->
  <PackageGroupRef Id="NetFx472Redist"/>
</Chain>
@dgxhubbard

This comment has been minimized.

Show comment
Hide comment
@dgxhubbard

dgxhubbard Jun 28, 2018

Thanks @Mawe9999 for the 4.7.2 update

dgxhubbard commented Jun 28, 2018

Thanks @Mawe9999 for the 4.7.2 update

@InkUisitor

This comment has been minimized.

Show comment
Hide comment
@InkUisitor

InkUisitor commented Jul 3, 2018

Thanks @Mawe9999 !

@henning-krause

This comment has been minimized.

Show comment
Hide comment
@henning-krause

henning-krause Aug 10, 2018

The links in the sample from @Mawe9999 should be changed to https. Otherwise an installer might fail when run on a Windows Server with the Enhanced Security configuration enabled.

henning-krause commented Aug 10, 2018

The links in the sample from @Mawe9999 should be changed to https. Otherwise an installer might fail when run on a Windows Server with the Enhanced Security configuration enabled.

@Spocher

This comment has been minimized.

Show comment
Hide comment
@Spocher

Spocher Aug 11, 2018

Please Help! In code @Mawe9999 on Build i get error: Unresolved reference to symbol 'WixSearch:NETFRAMEWORK45' in section 'Fragment:'

Solved: I'm forgot add reference to WixNetFxExtension in Bootstrapper

Spocher commented Aug 11, 2018

Please Help! In code @Mawe9999 on Build i get error: Unresolved reference to symbol 'WixSearch:NETFRAMEWORK45' in section 'Fragment:'

Solved: I'm forgot add reference to WixNetFxExtension in Bootstrapper

@Spocher

This comment has been minimized.

Show comment
Hide comment
@Spocher

Spocher Aug 11, 2018

Tell me somebody how include vc_redist in Bootstrapper

Spocher commented Aug 11, 2018

Tell me somebody how include vc_redist in Bootstrapper

@robmen

This comment has been minimized.

Show comment
Hide comment
@robmen

robmen Aug 11, 2018

Member

@Spocher, for support please contact the wix-users mailing list.

Member

robmen commented Aug 11, 2018

@Spocher, for support please contact the wix-users mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment