放弃 HMCLauncher 与 Windows XP 的兼容性 (#2644)

* 放弃 HMCLauncher 与 Windows XP 的兼容性

* update

* Delete unused code

* Disable automatic updates on Windows XP/Vista
This commit is contained in:
Glavo
2024-01-21 00:06:25 +08:00
committed by GitHub
parent 931808d808
commit 89b5b64943
8 changed files with 55 additions and 36 deletions

View File

@@ -227,6 +227,30 @@ public enum OperatingSystem {
return UNKNOWN;
}
public static boolean isWindows7OrLater() {
if (CURRENT_OS != WINDOWS) {
return false;
}
int major;
int dotIndex = SYSTEM_VERSION.indexOf('.');
try {
if (dotIndex < 0) {
major = Integer.parseInt(SYSTEM_VERSION);
} else {
major = Integer.parseInt(SYSTEM_VERSION.substring(0, dotIndex));
}
} catch (NumberFormatException ignored) {
return false;
}
// Windows XP: NT 5.1~5.2
// Windows Vista: NT 6.0
// Windows 7: NT 6.1
return major >= 6 && !SYSTEM_VERSION.startsWith("6.0");
}
@SuppressWarnings("deprecation")
public static Optional<PhysicalMemoryStatus> getPhysicalMemoryStatus() {
if (CURRENT_OS == LINUX) {