From a381aaf58d49c6aff80b3693922c57a8deeea8e1 Mon Sep 17 00:00:00 2001 From: xianyunleo Date: Tue, 9 Jan 2024 19:01:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=A3=80=E6=B5=8Barm=20mac?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AE=89=E8=A3=85=E4=BA=86Rosetta=20Runtime?= =?UTF-8?q?=20feature=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E8=B7=AF=E5=BE=84=E6=98=AF=E5=90=A6=E5=8C=85?= =?UTF-8?q?=E5=90=AB=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/App.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/App.js b/src/main/App.js index 025a938b..3b3f15d7 100644 --- a/src/main/App.js +++ b/src/main/App.js @@ -24,7 +24,7 @@ export default class App { } static async isInstallRosetta() { - return await FsUtil.Exists('/usr/libexec/rosetta/runtime') + return await FsUtil.Exists('/Library/Apple/usr/libexec/oah/libRosettaRuntime') } static async init() { @@ -62,10 +62,15 @@ export default class App { } static async checkInstall(){ - if (GetAppPath.getDir().includes(' ')) { + const appPath = GetAppPath.getDir() + if (appPath.includes(' ')) { throw new Error('安装路径不能包含空格!') } + if (/[\u4e00-\u9fa5]/.test(appPath)) { + throw new Error('安装路径不能包含中文!') + } + if (isWindows) { const hmc = require('hmc-win32') const semverDiff = require('semver-diff')