Merge branch 'Arch_Check' into 'master'
Improve OS-based Arch check See merge request sheepitrenderfarm/client!150
This commit is contained in:
@@ -94,6 +94,17 @@ public class Linux extends OS {
|
||||
return builder.start();
|
||||
}
|
||||
|
||||
@Override public boolean isSupported() {
|
||||
String arch = System.getProperty("os.arch").toLowerCase();
|
||||
return
|
||||
super.isSupported() &&
|
||||
(
|
||||
"amd64".equals(arch) ||
|
||||
"x64".equals(arch) ||
|
||||
"x86_64".equals(arch)
|
||||
);
|
||||
}
|
||||
|
||||
@Override public boolean getSupportHighPriority() {
|
||||
try {
|
||||
ProcessBuilder builder = new ProcessBuilder();
|
||||
|
||||
@@ -79,13 +79,21 @@ public class Windows extends OS {
|
||||
|
||||
@Override public boolean isSupported() {
|
||||
long buildNumber = Long.MIN_VALUE;
|
||||
String arch = System.getProperty("os.arch").toLowerCase();
|
||||
try {
|
||||
buildNumber = Long.parseLong(operatingSystem.getVersionInfo().getBuildNumber());
|
||||
}
|
||||
catch(NumberFormatException e) {
|
||||
System.err.println("Windows::isSupported Failed to extract Windows build number: " + e);
|
||||
}
|
||||
return super.isSupported() && buildNumber >= MINIMUM_SUPPORTED_BUILD;
|
||||
return
|
||||
super.isSupported() &&
|
||||
buildNumber >= MINIMUM_SUPPORTED_BUILD &&
|
||||
(
|
||||
"amd64".equals(arch) ||
|
||||
"x64".equals(arch) ||
|
||||
"x86_64".equals(arch)
|
||||
);
|
||||
}
|
||||
|
||||
int getPriorityClass(int priority) {
|
||||
|
||||
Reference in New Issue
Block a user