Skip to content

Commit

Permalink
Add support for detecting the Windows 10 May 2019 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Oren Novotny committed Apr 4, 2019
1 parent 2dd745b commit 6c69c5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions OSVersionHelper/Windows10Release.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@ public enum Windows10Release
/// 10.0.17763.0 (Redstone 5)
/// </summary>
October2018 = 1809,

/// <summary>
/// 10.0.18362.0 (19H01)
/// </summary>
May2019 = 1903,
}
}
11 changes: 10 additions & 1 deletion OSVersionHelper/WindowsVersionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ static WindowsVersionHelper()
{
if (IsSince(WindowsVersions.Win10))
{
if (IsApiContractPresent(7))
if (IsApiContractPresent(8))
{
Windows10Release = Windows10Release.May2019;
}
else if (IsApiContractPresent(7))
{
Windows10Release = Windows10Release.October2018;
}
Expand Down Expand Up @@ -65,6 +69,11 @@ static WindowsVersionHelper()

public static bool IsWindows10 { get; } = IsWindowsNt && IsSince(WindowsVersions.Win10);

/// <summary>
/// Gets a value indicating whether the current OS is Windows 10 May 2019 Update (19H01) or greater
/// </summary>
public static bool IsWindows10May2019OrGreater => IsWindows10 && Windows10Release >= Windows10Release.May2019;

/// <summary>
/// Gets a value indicating whether the current OS is Windows 10 October 2018 Update (Redstone 5) or greater
/// </summary>
Expand Down

0 comments on commit 6c69c5d

Please sign in to comment.