mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for detecting macOS 11 and 12.
This commit is contained in:
@@ -79,7 +79,7 @@ public static class DetectOS
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if(!IsWindows)
|
if(!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
return Environment.UserName == "root";
|
return Environment.UserName == "root";
|
||||||
|
|
||||||
bool isAdmin;
|
bool isAdmin;
|
||||||
@@ -223,6 +223,9 @@ public static class DetectOS
|
|||||||
switch(GetRealPlatformID())
|
switch(GetRealPlatformID())
|
||||||
{
|
{
|
||||||
case PlatformID.MacOSX:
|
case PlatformID.MacOSX:
|
||||||
|
if(Environment.OSVersion.Version.Major >= 11)
|
||||||
|
return environ;
|
||||||
|
|
||||||
if(Environment.OSVersion.Version.Major != 1)
|
if(Environment.OSVersion.Version.Major != 1)
|
||||||
return $"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}";
|
return $"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}";
|
||||||
|
|
||||||
@@ -281,13 +284,13 @@ public static class DetectOS
|
|||||||
!int.TryParse(pieces[1], out int minor))
|
!int.TryParse(pieces[1], out int minor))
|
||||||
return "macOS";
|
return "macOS";
|
||||||
|
|
||||||
if(minor >= 12)
|
int.TryParse(pieces[0], out int major);
|
||||||
|
|
||||||
|
if(minor >= 12 ||
|
||||||
|
major >= 11)
|
||||||
return "macOS";
|
return "macOS";
|
||||||
|
|
||||||
if(minor >= 8)
|
return minor >= 8 ? "OS X" : "Mac OS X";
|
||||||
return "OS X";
|
|
||||||
|
|
||||||
return "Mac OS X";
|
|
||||||
|
|
||||||
case PlatformID.Minix: return "MINIX";
|
case PlatformID.Minix: return "MINIX";
|
||||||
case PlatformID.NetBSD: return "NetBSD";
|
case PlatformID.NetBSD: return "NetBSD";
|
||||||
|
|||||||
Reference in New Issue
Block a user