mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Add rosetta check
This commit is contained in:
parent
2ca2eefb29
commit
dc93536be9
2 changed files with 28 additions and 0 deletions
|
@ -0,0 +1,26 @@
|
|||
package io.xpipe.app.core.check;
|
||||
|
||||
import io.xpipe.app.core.AppProperties;
|
||||
import io.xpipe.app.issue.ErrorEvent;
|
||||
import io.xpipe.app.util.LocalShell;
|
||||
import io.xpipe.core.process.OsType;
|
||||
|
||||
public class AppRosettaCheck {
|
||||
|
||||
public static void check() throws Exception {
|
||||
if (OsType.getLocal() != OsType.MACOS) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AppProperties.get().getArch().equals("x86_64")) {
|
||||
return;
|
||||
}
|
||||
|
||||
var ret = LocalShell.getShell().executeSimpleStringCommand("sysctl -n sysctl.proc_translated");
|
||||
if (ret.equals("1")) {
|
||||
ErrorEvent.fromMessage("You are running the Intel version of XPipe on an Apple Silicon system." +
|
||||
" There is a native build available that comes with much better performance." +
|
||||
" Please install that one instead.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import io.xpipe.app.comp.store.StoreViewState;
|
|||
import io.xpipe.app.core.*;
|
||||
import io.xpipe.app.core.check.AppAvCheck;
|
||||
import io.xpipe.app.core.check.AppCertutilCheck;
|
||||
import io.xpipe.app.core.check.AppRosettaCheck;
|
||||
import io.xpipe.app.core.check.AppShellCheck;
|
||||
import io.xpipe.app.ext.ActionProvider;
|
||||
import io.xpipe.app.ext.DataStoreProviders;
|
||||
|
@ -51,6 +52,7 @@ public class BaseMode extends OperationMode {
|
|||
AppSid.init();
|
||||
LocalShell.init();
|
||||
AppShellCheck.check();
|
||||
AppRosettaCheck.check();
|
||||
XPipeDistributionType.init();
|
||||
AppPrefs.setLocalDefaultsIfNeeded();
|
||||
// Initialize beacon server as we should be prepared for git askpass commands
|
||||
|
|
Loading…
Reference in a new issue