Skip to content

Commit

Permalink
fix:检测arm mac是否安装了Rosetta Runtime
Browse files Browse the repository at this point in the history
feature:增加判断安装路径是否包含中文
  • Loading branch information
xianyunleo committed Jan 9, 2024
1 parent 53b2c37 commit a381aaf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit a381aaf

Please sign in to comment.