Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucene.Net.Util.Constants: Updated to detect .NET Framework 4.8.1 #939

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Lucene.Net/Util/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public static class Constants // LUCENENET specific - made static because all me

/// <summary>
/// True iff running on SunOS. </summary>
public static readonly bool SUN_OS = RuntimeInformation.IsOSPlatform(OSPlatform.Create("SunOS"));
public static readonly bool SUN_OS = RuntimeInformation.IsOSPlatform(OSPlatform.Create("SUNOS"));

/// <summary>
/// True iff running on Mac OS X </summary>
public static readonly bool MAC_OS_X = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

/// <summary>
/// True iff running on FreeBSD </summary>
public static readonly bool FREE_BSD = RuntimeInformation.IsOSPlatform(OSPlatform.Create("FreeBSD"));
public static readonly bool FREE_BSD = RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD"));

// Possible Values: X86, X64, Arm, Arm64
public static readonly string OS_ARCH = RuntimeInformation.OSArchitecture.ToString();
Expand Down Expand Up @@ -197,6 +197,8 @@ private static string GetFramework45PlusFromRegistry()
// Checking the version using >= will enable forward compatibility.
private static string CheckFor45PlusVersion(int releaseKey)
{
if (releaseKey >= 533320)
return "4.8.1";
if (releaseKey >= 460799)
return "4.8";
if (releaseKey >= 460798)
Expand Down Expand Up @@ -241,4 +243,4 @@ private static string ExtractString(string input, Regex pattern)
return (m.Groups.Count > 1) ? m.Groups[1].Value : string.Empty;
}
}
}
}
Loading