Skip to content

Commit 1c7c613

Browse files
authored
Merge pull request #6 from AButler/support-4.6.2
[.NET] Support .NET 4.6.2
2 parents 6f6699d + 765d915 commit 1c7c613

File tree

5 files changed

+34
-1
lines changed

5 files changed

+34
-1
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.6.2 = .NET Framework v4.6.2
2627
* v4.6.1 = .NET Framework v4.6.1
2728
* v4.6 = .NET Framework v4.6
2829
* v4.5.2 = .NET Framework v4.5.2
@@ -108,7 +109,10 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpC
108109
bool IsDotNetFxInstalled( const TCHAR* version ) {
109110
DotNetVersion dotNetVersion;
110111

111-
if( _tcscmp( version, _T( "v4.6.1" ) ) == 0 ) {
112+
if( _tcscmp( version, _T( "v4.6.2" ) ) == 0 ) {
113+
// .NET 4.6.2
114+
return dotNetVersion.IsNetfx462Installed();
115+
} else if( _tcscmp( version, _T( "v4.6.1" ) ) == 0 ) {
112116
// .NET 4.6.1
113117
return dotNetVersion.IsNetfx461Installed();
114118
} else if( _tcscmp( version, _T( "v4.6" ) ) == 0 ) {
0 Bytes
Binary file not shown.

DotNetBootstrapper/DotNetVersion.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,30 @@ bool DotNetVersion::IsNetfx461Installed()
297297
return bRetValue;
298298
}
299299

300+
/******************************************************************
301+
Function Name: IsNetfx462Installed
302+
Description: Uses the detection method recommended at
303+
http://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx
304+
to determine whether the .NET Framework 4.6.1 is
305+
installed on the machine
306+
Inputs: NONE
307+
Results: true if the .NET Framework 4.6.2 is installed
308+
false otherwise
309+
******************************************************************/
310+
bool DotNetVersion::IsNetfx462Installed()
311+
{
312+
bool bRetValue = false;
313+
DWORD dwRegValue = 0;
314+
315+
if (RegistryGetValue(HKEY_LOCAL_MACHINE, g_szNetfx45RegKeyName, g_szNetfx45RegValueName, NULL, (LPBYTE)&dwRegValue, sizeof(DWORD)))
316+
{
317+
if (g_dwNetfx462ReleaseVersion <= dwRegValue)
318+
bRetValue = true;
319+
}
320+
321+
return bRetValue;
322+
}
323+
300324
/******************************************************************
301325
Function Name: CheckNetfxBuildNumber
302326
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
@@ -57,6 +57,9 @@ const int g_dwNetfx46ReleaseVersion = 393295;
5757
// Version information for final release of .NET Framework 4.6.1
5858
const int g_dwNetfx461ReleaseVersion = 394254;
5959

60+
// Version information for final release of .NET Framework 4.6.2
61+
const int g_dwNetfx462ReleaseVersion = 394802;
62+
6063
class DotNetVersion {
6164
private:
6265
bool CheckNetfxBuildNumber(const TCHAR *pszNetfxRegKeyName, const TCHAR *pszNetfxRegKeyValue, const int iRequestedVersionMajor, const int iRequestedVersionMinor, const int iRequestedVersionBuild, const int iRequestedVersionRevision);
@@ -75,4 +78,5 @@ class DotNetVersion {
7578
bool IsNetfx452Installed();
7679
bool IsNetfx46Installed();
7780
bool IsNetfx461Installed();
81+
bool IsNetfx462Installed();
7882
};

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.6.2` | .NET Framework v4.6.2 |
2425
| `v4.6.1` | .NET Framework v4.6.1 |
2526
| `v4.6` | .NET Framework v4.6 |
2627
| `v4.5.2` | .NET Framework v4.5.2 |

0 commit comments

Comments
 (0)