!74 修复arm64一直跳过下载chromium 无法安装浏览器

Merge pull request !74 from 所有二刺螈都得死/master
This commit is contained in:
Kokomi 2023-08-13 18:52:31 +00:00 committed by Gitee
commit 6637fb5951
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 10 additions and 12 deletions

View File

@ -3,22 +3,20 @@ const { existsSync } = require("fs");
const arch = os.arch();
let skipDownload = false;
let executablePath;
// win32 存在 Edge 优先选择
if (process.platform == "win32") {
if (
existsSync("C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")
) {
if (existsSync("C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe")) {
skipDownload = true;
executablePath =
"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
executablePath = "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe";
}
} else if (process.platform == "linux") {
//如果arm64架构跳过下载
if (arch == "arm64" || arch == "aarch64") {
// 如果 arm64 架构且存在 Chromium跳过下载
if ((arch == "arm64" || arch == "aarch64") && existsSync("/usr/bin/chromium")) {
skipDownload = true;
}
//不管什么架构,如果存在配置则跳过下载,且配置路径
if (existsSync("/usr/bin/chromium")) {
executablePath = "/usr/bin/chromium";
} else if (existsSync("/usr/bin/chromium")) {
// 不论什么架构,如果存在 Chromium跳过下载且配置路径
skipDownload = true;
executablePath = "/usr/bin/chromium";
}