mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-30 10:18:44 -04:00
Fix OS version check
This commit is contained in:
parent
500d448fe3
commit
95b971150b
1 changed files with 20 additions and 4 deletions
|
@ -118,14 +118,30 @@ public class Utilities {
|
||||||
return System.getProperty("os.name").toLowerCase();
|
return System.getProperty("os.name").toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO remove logs
|
||||||
public static boolean isCorrectOSArchitecture() {
|
public static boolean isCorrectOSArchitecture() {
|
||||||
String osArch = System.getProperty("os.arch");
|
|
||||||
String jvmArch = System.getProperty("sun.arch.data.model");
|
String jvmArch = System.getProperty("sun.arch.data.model");
|
||||||
//TODO remove log
|
|
||||||
log.warn("osArch " + osArch);
|
|
||||||
log.warn("jvmArch " + jvmArch);
|
log.warn("jvmArch " + jvmArch);
|
||||||
|
log.warn("System.getenv(\"ProgramFiles(x86)\") " + System.getenv("ProgramFiles(x86)"));
|
||||||
|
if (isWindows()) {
|
||||||
|
// See: https://stackoverflow.com/questions/20856694/how-to-find-the-os-bit-type
|
||||||
|
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
|
||||||
|
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
|
||||||
|
|
||||||
|
String realArch = arch.endsWith("64")
|
||||||
|
|| wow64Arch != null && wow64Arch.endsWith("64")
|
||||||
|
? "64" : "32";
|
||||||
|
|
||||||
|
log.warn("arch " + arch);
|
||||||
|
log.warn("wow64Arch " + wow64Arch);
|
||||||
|
log.warn("realArch " + realArch);
|
||||||
|
return realArch.endsWith(jvmArch);
|
||||||
|
} else {
|
||||||
|
String osArch = System.getProperty("os.arch");
|
||||||
|
log.warn("osArch " + osArch);
|
||||||
return osArch.endsWith(jvmArch);
|
return osArch.endsWith(jvmArch);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void openURI(URI uri) throws IOException {
|
public static void openURI(URI uri) throws IOException {
|
||||||
if (!isLinux()
|
if (!isLinux()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue