Skip to content

Commit c94a9d1

Browse files
committed
Merge pull request #5 from AButler/support-4.6.1
[.NET] Support .NET 4.6.1
2 parents 365dca4 + 9ed8ec6 commit c94a9d1

File tree

7 files changed

+46
-9
lines changed

7 files changed

+46
-9
lines changed

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@
2020
*.out
2121
*.app
2222

23-
# Visual Studio
23+
# Visual C++ cache files
2424
*.suo
25-
/*.sdf
26-
/*.opensdf
27-
/ipch
25+
*.sdf
26+
*.ncb
27+
*.opendb
28+
*.opensdf
29+
ipch/
2830
*.user
2931
*.aps
32+
*.cachefile
3033

3134
# Custom
3235
Debug
3336
Release
37+
.vs

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

110-
if( _tcscmp( version, _T( "v4.6" ) ) == 0 ) {
111+
if( _tcscmp( version, _T( "v4.6.1" ) ) == 0 ) {
112+
// .NET 4.6.1
113+
return dotNetVersion.IsNetfx461Installed();
114+
} else if( _tcscmp( version, _T( "v4.6" ) ) == 0 ) {
111115
// .NET 4.6
112116
return dotNetVersion.IsNetfx46Installed();
113117
} else if( _tcscmp( version, _T( "v4.5.2" ) ) == 0 ) {
8 Bytes
Binary file not shown.

DotNetBootstrapper/DotNetBootstrapper.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -19,13 +19,13 @@
1919
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2020
<ConfigurationType>Application</ConfigurationType>
2121
<UseDebugLibraries>true</UseDebugLibraries>
22-
<PlatformToolset>v110</PlatformToolset>
22+
<PlatformToolset>v140</PlatformToolset>
2323
<CharacterSet>Unicode</CharacterSet>
2424
</PropertyGroup>
2525
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2626
<ConfigurationType>Application</ConfigurationType>
2727
<UseDebugLibraries>false</UseDebugLibraries>
28-
<PlatformToolset>v110</PlatformToolset>
28+
<PlatformToolset>v140</PlatformToolset>
2929
<WholeProgramOptimization>true</WholeProgramOptimization>
3030
<CharacterSet>Unicode</CharacterSet>
3131
</PropertyGroup>

DotNetBootstrapper/DotNetVersion.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,30 @@ bool DotNetVersion::IsNetfx46Installed()
273273
return bRetValue;
274274
}
275275

276+
/******************************************************************
277+
Function Name: IsNetfx461Installed
278+
Description: Uses the detection method recommended at
279+
http://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx
280+
to determine whether the .NET Framework 4.6.1 is
281+
installed on the machine
282+
Inputs: NONE
283+
Results: true if the .NET Framework 4.6.1 is installed
284+
false otherwise
285+
******************************************************************/
286+
bool DotNetVersion::IsNetfx461Installed()
287+
{
288+
bool bRetValue = false;
289+
DWORD dwRegValue=0;
290+
291+
if (RegistryGetValue(HKEY_LOCAL_MACHINE, g_szNetfx45RegKeyName, g_szNetfx45RegValueName, NULL, (LPBYTE)&dwRegValue, sizeof(DWORD)))
292+
{
293+
if (g_dwNetfx461ReleaseVersion <= dwRegValue)
294+
bRetValue = true;
295+
}
296+
297+
return bRetValue;
298+
}
299+
276300
/******************************************************************
277301
Function Name: CheckNetfxBuildNumber
278302
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
@@ -54,6 +54,9 @@ static const int g_dwNetfx452ReleaseVersion = 379893;
5454
// Version information for final release of .NET Framework 4.6
5555
const int g_dwNetfx46ReleaseVersion = 393295;
5656

57+
// Version information for final release of .NET Framework 4.6.1
58+
const int g_dwNetfx461ReleaseVersion = 394254;
59+
5760
class DotNetVersion {
5861
private:
5962
bool CheckNetfxBuildNumber(const TCHAR *pszNetfxRegKeyName, const TCHAR *pszNetfxRegKeyValue, const int iRequestedVersionMajor, const int iRequestedVersionMinor, const int iRequestedVersionBuild, const int iRequestedVersionRevision);
@@ -71,4 +74,5 @@ class DotNetVersion {
7174
bool IsNetfx451Installed();
7275
bool IsNetfx452Installed();
7376
bool IsNetfx46Installed();
77+
bool IsNetfx461Installed();
7478
};

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ DotNetBootstrapper.exe <Version> <Application> [<Arguments>]
2121

2222
| `<Version>` | .NET Framework Version |
2323
| --------------- | --------------------------------------- |
24-
| `v4.6 ` | .NET Framework v4.6 |
24+
| `v4.6.1` | .NET Framework v4.6 |
25+
| `v4.6` | .NET Framework v4.6 |
2526
| `v4.5.2` | .NET Framework v4.5.2 |
2627
| `v4.5.1` | .NET Framework v4.5.1 |
2728
| `v4.5` | .NET Framework v4.5 |

0 commit comments

Comments
 (0)