Skip to content

Commit 76d2ad8

Browse files
authored
Merge pull request #9 from AButler/support-4.7.1
[.NET] Support .NET 4.7.1
2 parents d86df35 + ee0452b commit 76d2ad8

File tree

6 files changed

+36
-2
lines changed

6 files changed

+36
-2
lines changed

DotNetBootstrapper/DotNetBootstrapper.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const TCHAR* GetFriendlyVersion( const TCHAR* version );
2323
2424
Supported Versions:
2525
26+
* v4.7.1 = .NET Framework v4.7.1
2627
* v4.7 = .NET Framework v4.7
2728
* v4.6.2 = .NET Framework v4.6.2
2829
* v4.6.1 = .NET Framework v4.6.1
@@ -110,7 +111,10 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpC
110111
bool IsDotNetFxInstalled( const TCHAR* version ) {
111112
DotNetVersion dotNetVersion;
112113

113-
if( _tcscmp( version, _T( "v4.7" ) ) == 0 ) {
114+
if( _tcscmp( version, _T( "v4.7.1" ) ) == 0 ) {
115+
// .NET 4.7.1
116+
return dotNetVersion.IsNetfx471Installed();
117+
} else if( _tcscmp( version, _T( "v4.7" ) ) == 0 ) {
114118
// .NET 4.7
115119
return dotNetVersion.IsNetfx47Installed();
116120
} else if ( _tcscmp( version, _T( "v4.6.2" ) ) == 0 ) {
0 Bytes
Binary file not shown.

DotNetBootstrapper/DotNetBootstrapper.vcxproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<ProjectGuid>{0FD1B168-73DE-4EE2-BA14-CA4E3C577B0E}</ProjectGuid>
1515
<Keyword>Win32Proj</Keyword>
1616
<RootNamespace>DotNetBootstrapper</RootNamespace>
17+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
1718
</PropertyGroup>
1819
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1920
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -25,7 +26,7 @@
2526
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2627
<ConfigurationType>Application</ConfigurationType>
2728
<UseDebugLibraries>false</UseDebugLibraries>
28-
<PlatformToolset>v140</PlatformToolset>
29+
<PlatformToolset>v141</PlatformToolset>
2930
<WholeProgramOptimization>true</WholeProgramOptimization>
3031
<CharacterSet>Unicode</CharacterSet>
3132
</PropertyGroup>

DotNetBootstrapper/DotNetVersion.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,30 @@ bool DotNetVersion::IsNetfx47Installed()
345345
return bRetValue;
346346
}
347347

348+
/******************************************************************
349+
Function Name: IsNetfx471Installed
350+
Description: Uses the detection method recommended at
351+
https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx
352+
to determine whether the .NET Framework 4.7.1 is
353+
installed on the machine
354+
Inputs: NONE
355+
Results: true if the .NET Framework 4.7.1 is installed
356+
false otherwise
357+
******************************************************************/
358+
bool DotNetVersion::IsNetfx471Installed()
359+
{
360+
bool bRetValue = false;
361+
DWORD dwRegValue = 0;
362+
363+
if (RegistryGetValue(HKEY_LOCAL_MACHINE, g_szNetfx45RegKeyName, g_szNetfx45RegValueName, NULL, (LPBYTE)&dwRegValue, sizeof(DWORD)))
364+
{
365+
if (g_dwNetfx471ReleaseVersion <= dwRegValue)
366+
bRetValue = true;
367+
}
368+
369+
return bRetValue;
370+
}
371+
348372
/******************************************************************
349373
Function Name: CheckNetfxBuildNumber
350374
Description: Retrieves the .NET Framework build number from

DotNetBootstrapper/DotNetVersion.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ const int g_dwNetfx462ReleaseVersion = 394802;
6363
// Version information for final release of .NET Framework 4.7
6464
const int g_dwNetfx47ReleaseVersion = 460798;
6565

66+
// Version information for final release of .NET Framework 4.7.1
67+
const int g_dwNetfx471ReleaseVersion = 461308;
68+
6669
class DotNetVersion {
6770
private:
6871
bool CheckNetfxBuildNumber(const TCHAR *pszNetfxRegKeyName, const TCHAR *pszNetfxRegKeyValue, const int iRequestedVersionMajor, const int iRequestedVersionMinor, const int iRequestedVersionBuild, const int iRequestedVersionRevision);
@@ -83,4 +86,5 @@ class DotNetVersion {
8386
bool IsNetfx461Installed();
8487
bool IsNetfx462Installed();
8588
bool IsNetfx47Installed();
89+
bool IsNetfx471Installed();
8690
};

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ DotNetBootstrapper.exe <Version> <Application> [<Arguments>]
2121

2222
| `<Version>` | .NET Framework Version |
2323
| --------------- | --------------------------------------- |
24+
| `v4.7.1` | .NET Framework v4.7.1 |
2425
| `v4.7` | .NET Framework v4.7 |
2526
| `v4.6.2` | .NET Framework v4.6.2 |
2627
| `v4.6.1` | .NET Framework v4.6.1 |

0 commit comments

Comments
 (0)