From cd39c1ec12d729c96f2d64b001ae0e42096c1720 Mon Sep 17 00:00:00 2001 From: breadbyte Date: Wed, 29 Mar 2023 20:15:22 +0800 Subject: [PATCH] Make UpgradeHelper compliant with .NET RID catalog Fetching updates return an error because the UpgradeHelper returns an invalid RID, and we use the RID to create automated builds. This updates the UpgradeHelper to be compliant with the catalog. --- MinecraftClient/UpgradeHelper.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/MinecraftClient/UpgradeHelper.cs b/MinecraftClient/UpgradeHelper.cs index 3843824b66..8c53da1692 100644 --- a/MinecraftClient/UpgradeHelper.cs +++ b/MinecraftClient/UpgradeHelper.cs @@ -241,27 +241,27 @@ private static string GetOSIdentifier() { string OSPlatformName; if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - OSPlatformName = "Windows"; + OSPlatformName = "win"; else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - OSPlatformName = "Linux"; + OSPlatformName = "linux"; else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - OSPlatformName = "OSX"; + OSPlatformName = "osx"; else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD)) - OSPlatformName = "FreeBSD"; + OSPlatformName = "freebsd"; else return string.Empty; string architecture = RuntimeInformation.ProcessArchitecture switch { - Architecture.X86 => "X86", - Architecture.X64 => "X64", - Architecture.Arm => "Arm32", - Architecture.Arm64 => "Arm64", - Architecture.Wasm => "Wasm", - Architecture.S390x => "S390x", - Architecture.LoongArch64 => "LoongArch64", - Architecture.Armv6 => "Armv6", - Architecture.Ppc64le => "Ppc64le", + Architecture.X86 => "x86", + Architecture.X64 => "x64", + Architecture.Arm => "arm32", + Architecture.Arm64 => "arm64", + Architecture.Wasm => "wasm", + Architecture.S390x => "s390x", + Architecture.LoongArch64 => "loongarch64", + Architecture.Armv6 => "armv6", + Architecture.Ppc64le => "ppc64le", _ => RuntimeInformation.ProcessArchitecture.ToString(), };