From 3f31278131e858de12da3c2ca2b522365247797d Mon Sep 17 00:00:00 2001 From: stark81 <849966181@qq.com> Date: Sat, 11 Apr 2026 16:01:06 +0800 Subject: [PATCH] fix-sandbox --- fix-sandbox.js | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 fix-sandbox.js diff --git a/fix-sandbox.js b/fix-sandbox.js new file mode 100644 index 0000000..cca78cd --- /dev/null +++ b/fix-sandbox.js @@ -0,0 +1,9 @@ +const { execSync } = require('child_process'); + +if (process.platform === 'linux') { + // You need to make sure that + // /home/runner/work/VutronMusic/VutronMusic/node_modules/electron/dist/chrome-sandbox + // is owned by root and has mode 4755. + execSync('sudo chown root:root ./node_modules/electron/dist/chrome-sandbox'); + execSync('sudo chmod 4755 ./node_modules/electron/dist/chrome-sandbox'); +} diff --git a/package.json b/package.json index b873b8a..e5419c5 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dev": "electron-vite dev", "dev:web": "vite dev", "build": "electron-vite build", - "postinstall": "electron-builder install-app-deps", + "postinstall": "node fix-sandbox.js && electron-builder install-app-deps", "build:unpack": "npm run build && electron-builder --dir", "build:win": "npm run build && electron-builder --win --publish never", "build:mac": "npm run build && electron-builder --mac --x64 --publish never && cp dist/latest-mac.yml dist/latest-mac-x64.yml && electron-builder --mac --arm64 --publish never && cp dist/latest-mac.yml dist/latest-mac-arm64.yml && node scripts/merge_latest_mac_yml.mjs dist/latest-mac-x64.yml dist/latest-mac-arm64.yml dist/latest-mac.yml",