From 74fd35047c6b67a11a0a589e85825fc406603bd3 Mon Sep 17 00:00:00 2001 From: Glavo Date: Thu, 14 Oct 2021 04:39:29 +0800 Subject: [PATCH] Use 'PROCESSOR_IDENTIFIER' to determine the architecture on Windows --- .../org/jackhuang/hmcl/util/platform/Architecture.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/Architecture.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/Architecture.java index 2a9660527..d3901bd7d 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/Architecture.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/Architecture.java @@ -181,13 +181,17 @@ public enum Architecture { static { CURRENT_ARCH_NAME = System.getProperty("os.arch"); - CURRENT_ARCH = parseArchName(CURRENT_ARCH_NAME); String sysArchName = null; - if (OperatingSystem.CURRENT_OS == OperatingSystem.WINDOWS) { - sysArchName = System.getenv("PROCESSOR_ARCHITECTURE").trim(); + String processorIdentifier = System.getenv("PROCESSOR_IDENTIFIER"); + if (processorIdentifier != null) { + int idx = processorIdentifier.indexOf(' '); + if (idx > 0) { + sysArchName = processorIdentifier.substring(0, idx); + } + } } else { try { Process process = Runtime.getRuntime().exec("/usr/bin/arch");