From e570bbebde6971c8c28003afaeaf9051d2bc136b Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 20 Feb 2026 01:27:10 +0900 Subject: [PATCH] feat(package): add afterInstall script for chrome-sandbox permissions (#27) (#28) - Updated package.json to include an afterInstall script that adjusts permissions for the chrome-sandbox on Linux. - Added new afterInstall.sh script to ensure proper ownership and permissions for the sandbox file, enhancing security and functionality. --- package.json | 3 ++- resources/afterInstall.sh | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 resources/afterInstall.sh diff --git a/package.json b/package.json index ac50ab09..4a9093b0 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,8 @@ "pacman" ], "icon": "resources/icons/png", - "category": "Development" + "category": "Development", + "afterInstall": "resources/afterInstall.sh" }, "nsis": { "oneClick": false, diff --git a/resources/afterInstall.sh b/resources/afterInstall.sh new file mode 100755 index 00000000..4f472b3a --- /dev/null +++ b/resources/afterInstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Fix chrome-sandbox permissions for SUID sandbox on Linux +# See: https://github.com/electron/electron/issues/17972 + +SANDBOX_PATH="/opt/${productFilename}/chrome-sandbox" + +if [ -f "$SANDBOX_PATH" ]; then + chown root:root "$SANDBOX_PATH" + chmod 4755 "$SANDBOX_PATH" +fi