From 192f6b602f72cd21026b9d17d649d4bef44011c6 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Tue, 24 Sep 2024 21:26:16 -0700 Subject: [PATCH] Fix chrome sandbox issue on Ubuntu (#835) --- build/deb-postinstall.tpl | 21 +++++++++++++++++++++ electron-builder.config.cjs | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 build/deb-postinstall.tpl diff --git a/build/deb-postinstall.tpl b/build/deb-postinstall.tpl new file mode 100644 index 000000000..71c721860 --- /dev/null +++ b/build/deb-postinstall.tpl @@ -0,0 +1,21 @@ +#!/bin/bash + +if type update-alternatives 2>/dev/null >&1; then + # Remove previous link if it doesn't use update-alternatives + if [ -L '/usr/bin/waveterm' -a -e '/usr/bin/waveterm' -a "`readlink '/usr/bin/waveterm'`" != '/etc/alternatives/waveterm' ]; then + rm -f '/usr/bin/waveterm' + fi + update-alternatives --install '/usr/bin/waveterm' 'waveterm' '/opt/Wave/waveterm' 100 || ln -sf '/opt/Wave/waveterm' '/usr/bin/waveterm' +else + ln -sf '/opt/Wave/waveterm' '/usr/bin/waveterm' +fi + +chmod 4755 '/opt/Wave/chrome-sandbox' || true + +if hash update-mime-database 2>/dev/null; then + update-mime-database /usr/share/mime || true +fi + +if hash update-desktop-database 2>/dev/null; then + update-desktop-database /usr/share/applications || true +fi diff --git a/electron-builder.config.cjs b/electron-builder.config.cjs index 506ff5310..ca953adda 100644 --- a/electron-builder.config.cjs +++ b/electron-builder.config.cjs @@ -67,6 +67,9 @@ const config = { category: "Development;Utility;", }, }, + deb: { + afterInstall: "build/deb-postinstall.tpl", + }, win: { icon: "build/icons.icns", publisherName: "Command Line Inc",