diff --git a/Utils/PlatformHelper.cs b/Utils/PlatformHelper.cs index 4fb5ac8..43bcaa7 100644 --- a/Utils/PlatformHelper.cs +++ b/Utils/PlatformHelper.cs @@ -127,10 +127,20 @@ private static void DeterminePlatform() { */ try { string arch; - using (Process uname = Process.Start(new ProcessStartInfo("uname", "-m") { - UseShellExecute = false, - RedirectStandardOutput = true - })) { + ProcessStartInfo processInfo; + if (Is(Platform.MacOS)) { + // on Rosetta environment, `uname -m` shows actual hardware architecture "arm64" + // and `arch` shows current hardware architecture `i386` + // We want to know current architecture so we call arch instead of uname. + processInfo = new ProcessStartInfo("arch") { + UseShellExecute = false, RedirectStandardOutput = true + }; + } else { + processInfo = new ProcessStartInfo("uname", "-m") { + UseShellExecute = false, RedirectStandardOutput = true + }; + } + using (Process uname = Process.Start(processInfo)) { arch = uname.StandardOutput.ReadLine().Trim(); }