Skip to content

Add a new supported minor version of .NET Framework

Baptiste Courtois edited this page Jun 6, 2018 · 1 revision

The ms_dotnet_framework resource is complexe because it handles:

  • Windows feature installation when the specified.NET Framework is built-in
  • the different packages that may be required to setup a given .NET Framework on a specific Windows version
  • the potential prerequisites of thes packages
  • additional patches
  • required reboots between the various steps

The logic used to do so has been split in multiple files:

  • the libraries/package_helper.rb lists all installer packages, their download URL, checksum and identifier.
  • the libraries/vX_helper.rb manages the supported minor versions and installation methods of a given major version (X).

Below are the required step to add a new .NET minor Version

  1. Get the actual version name you want to use in the cookbook.

    Starting with .NET Framework 4.5 the versioning has been standardized: no more SP or "Client/Extended Profile". e.g. 4.7.2

  2. Find the support page for the Offline installer package for this version, it provides information required in next steps.

    e.g. https://support.microsoft.com/help/4054530

  3. Get the Offline installer download url - the one hosted on download.microsoft.com not the go.microsoft.com.

    e.g. https://download.microsoft.com/download/3/D/7/3D72C5C2-4CCB-4EEF-925D-B5FA33EAC25A/NDP472-KB4054530-x86-x64-AllOS-ENU.exe

  4. Compute/get the sha256 checksum of the offline installer.

    e.g. 63dc850df091f3f137b5d4392f47917f847f8926dc8af1da9bfba6422e495805

  5. Get the product or update names of this .NET Framework according to the supported Windows version.

    Info available on the KB page dedicated to the offline installer. e.g. .NET Framework 4.7.2 on WS2008R2, KB4054542 on WS2012, KB4054566 on WS2012R2, KB4054590 on WS2016 and KB4073120 on Win10 v1709.

  6. Add your new .NET Framework version to the packages hash in libraries/package_helper.rb.

--- a/libraries/package_helper.rb
+++ b/libraries/package_helper.rb
@@ -106,6 +106,12 @@ module MSDotNet
           checksum: '63dc850df091f3f137b5d4392f47917f847f8926dc8af1da9bfba6422e495805',
           not_if: %w(KB4033342 KB4033345 KB4033369 KB4033393),
         },
+        '4.7.2' => {
+          name:     'Microsoft .NET Framework 4.7.2',
+          url:      'https://download.microsoft.com/download/3/D/7/3D72C5C2-4CCB-4EEF-925D-B5FA33EAC25A/NDP472-KB4054530-x86-x64-AllOS-ENU.exe',
+          checksum: '41eec7f2cfe216b7c063ca771485dcb18218ec329c48c80fd4ad1cdddfabc506',
+          not_if: %w(KB4054542 KB4054566 KB4054590 KB4073120),
+        },
         ###########
         # Patches
         ###########
  1. Register this new version as a supported minor version by updating the supported_version method of the libraries/vX_helper.rb file.
--- a/libraries/v4_helper.rb
+++ b/libraries/v4_helper.rb
@@ -49,3 +49,3 @@ module MSDotNet
     def supported_versions
-      @supported_versions ||= %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
+      @supported_versions ||= %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2)
     end
  1. Add the Microsoft internal build number identifier to the installed_version method of the libraries/vX_helper.rb file.

See https://docs.microsoft.com/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

--- a/libraries/v4_helper.rb
+++ b/libraries/v4_helper.rb
@@ -43,5 +43,6 @@ module MSDotNet
         when 394_802, 394_806 then '4.6.2'
         when 460_798, 460_805 then '4.7'
         when 461_308, 461_310 then '4.7.1'
+        when 461_808, 461_814 then '4.7.2'
       end
     end
  1. Register this new version in the feature_setup method of the libraries/vX_helper.rb file - only for the Windows version which include it as an optional features.

    See https://en.wikipedia.org/wiki/.NET_Framework#Release_history

--- a/libraries/v4_helper.rb
+++ b/libraries/v4_helper.rb
@@ -79,6 +79,6 @@ module MSDotNet
         when '10.0.15063' then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7)
         # Windows 10 & Server 2016 v1709 (RS3)
         when '10.0.16299' then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
         # Windows 10 & Server 2016 v1803 (RS4)
-        when '10.0.17134' then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
+        when '10.0.17134' then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2)
         # Other versions
  1. Register this new version in the package_setup method of the libraries/vX_helper.rb file - only for the Windows version supporting the installer.

    See the KB page dedicated to the offline installer.

--- a/libraries/v4_helper.rb
+++ a/libraries/v4_helper.rb
@@ -110,21 +110,21 @@ module MSDotNet
         # Windows Vista & Server 2008
         when /^6\.0/ then %w(4.0 4.5 4.5.1 4.5.2 4.6)
         # Windows 7 & Server 2008R2
-        when /^6\.1/ then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
+        when /^6\.1/ then %w(4.0 4.5 4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2)
         # Windows 8 & Server 2012
-        when /^6\.2/ then %w(4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
+        when /^6\.2/ then %w(4.5.1 4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2)
         # Windows 8.1 & Server 2012R2
-        when /^6\.3/ then %w(4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1)
+        when /^6\.3/ then %w(4.5.2 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2)
         # Windows 10 RTM (TH1)
-        when '10.0.10240' then %w(4.6.1 4.6.2 4.7 4.7.1)
+        when '10.0.10240' then %w(4.6.1 4.6.2 4.7 4.7.1 4.7.2)
         # Windows 10 v1511 (TH2)
-        when '10.0.10586' then %w(4.6.2 4.7 4.7.1)
+        when '10.0.10586' then %w(4.6.2 4.7 4.7.1 4.7.2)
         # Windows 10 & Server 2016 v1607 (RS1)
-        when '10.0.14393' then %w(4.7 4.7.1)
+        when '10.0.14393' then %w(4.7 4.7.1 4.7.2)
         # Windows 10 v1703 (RS2)
-        when '10.0.15063' then %w(4.7.1)
+        when '10.0.15063' then %w(4.7.1 4.7.2)
         # Windows 10 & Server 2016 v1709 (RS3)
-        when '10.0.16299' then []
+        when '10.0.16299' then %w(4.7.2)
         # Windows 10 & Server 2016 v1709 (RS3)
         when '10.0.17.134' then []
Clone this wiki locally