Skip to content

Commit eb09945

Browse files
authored
Merge pull request #11 from AButler/support-4.8
[.NET] Support .NET 4.8
2 parents 967474e + 3cb37bd commit eb09945

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-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.8 = .NET Framework v4.8
2627
* v4.7.2 = .NET Framework v4.7.2
2728
* v4.7.1 = .NET Framework v4.7.1
2829
* v4.7 = .NET Framework v4.7
@@ -112,7 +113,10 @@ int APIENTRY _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpC
112113
bool IsDotNetFxInstalled( const TCHAR* version ) {
113114
DotNetVersion dotNetVersion;
114115

115-
if( _tcscmp( version, _T( "v4.7.2" ) ) == 0 ) {
116+
if( _tcscmp( version, _T( "v4.8" ) ) == 0 ) {
117+
// .NET 4.8
118+
return dotNetVersion.IsNetfx48Installed();
119+
} else if( _tcscmp( version, _T( "v4.7.2" ) ) == 0 ) {
116120
// .NET 4.7.2
117121
return dotNetVersion.IsNetfx472Installed();
118122
} else if( _tcscmp( version, _T( "v4.7.1" ) ) == 0 ) {
0 Bytes
Binary file not shown.

DotNetBootstrapper/DotNetVersion.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,30 @@ bool DotNetVersion::IsNetfx472Installed()
393393
return bRetValue;
394394
}
395395

396+
/******************************************************************
397+
Function Name: IsNetfx48Installed
398+
Description: Uses the detection method recommended at
399+
https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx
400+
to determine whether the .NET Framework 4.8 is
401+
installed on the machine
402+
Inputs: NONE
403+
Results: true if the .NET Framework 4.8 is installed
404+
false otherwise
405+
******************************************************************/
406+
bool DotNetVersion::IsNetfx48Installed()
407+
{
408+
bool bRetValue = false;
409+
DWORD dwRegValue=0;
410+
411+
if (RegistryGetValue(HKEY_LOCAL_MACHINE, g_szNetfx45RegKeyName, g_szNetfx45RegValueName, NULL, (LPBYTE)&dwRegValue, sizeof(DWORD)))
412+
{
413+
if (g_dwNetfx48ReleaseVersion <= dwRegValue)
414+
bRetValue = true;
415+
}
416+
417+
return bRetValue;
418+
}
419+
396420
/******************************************************************
397421
Function Name: CheckNetfxBuildNumber
398422
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
@@ -69,6 +69,9 @@ const int g_dwNetfx471ReleaseVersion = 461308;
6969
// Version information for final release of .NET Framework 4.7.2
7070
const int g_dwNetfx472ReleaseVersion = 461808;
7171

72+
// Version information for final release of .NET Framework 4.8
73+
const int g_dwNetfx48ReleaseVersion = 528040;
74+
7275
class DotNetVersion {
7376
private:
7477
bool CheckNetfxBuildNumber(const TCHAR *pszNetfxRegKeyName, const TCHAR *pszNetfxRegKeyValue, const int iRequestedVersionMajor, const int iRequestedVersionMinor, const int iRequestedVersionBuild, const int iRequestedVersionRevision);
@@ -91,4 +94,5 @@ class DotNetVersion {
9194
bool IsNetfx47Installed();
9295
bool IsNetfx471Installed();
9396
bool IsNetfx472Installed();
97+
bool IsNetfx48Installed();
9498
};

0 commit comments

Comments
 (0)