mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 07:16:27 -04:00
Use 'PROCESSOR_IDENTIFIER' to determine the architecture on Windows
This commit is contained in:
parent
21a9d19105
commit
74fd35047c
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user