Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"core-js": "^3",
"cross-env": "5.0.5",
"cross-spawn": "6.0.5",
"electron-builder": "24.0.0-alpha.5",
"electron-builder": "^24.4.0",
"eslint": "^8.33.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-import-resolver-webpack": "^0.13.2",
Expand Down
12 changes: 10 additions & 2 deletions web/packages/teleterm/build_resources/linux/after-install.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -eu

###
# Default after-install.tpl copied from electron-builder.
# https://github.com/electron-userland/electron-builder/blob/v24.0.0-alpha.5/packages/app-builder-lib/templates/linux/after-install.tpl
# https://github.com/electron-userland/electron-builder/blob/v24.4.0/packages/app-builder-lib/templates/linux/after-install.tpl
###

# SUID chrome-sandbox for Electron 5+
Expand Down Expand Up @@ -32,7 +32,15 @@ TSH_SYMLINK_TARGET=$BIN/tsh
[ ! -d "$BIN" ] && mkdir -p "$BIN"

# Link to the Electron app binary.
ln -sf "$APP/${executable}" "$BIN/${executable}"
if type update-alternatives 2>/dev/null >&1; then
# Remove previous link if it doesn't use update-alternatives
if [ -L "$BIN/${executable}" -a -e "$BIN/${executable}" -a "`readlink "$BIN/${executable}"`" != "/etc/alternatives/${executable}" ]; then
rm -f "$BIN/${executable}"
fi
update-alternatives --install "$BIN/${executable}" "${executable}" "$APP/${executable}" 100
else
ln -sf "$APP/${executable}" "$BIN/${executable}"
fi

# Link to the bundled tsh if the symlink doesn't exist already. Otherwise echo a message unless the
# link points to teleport-connect's tsh already.
Expand Down
7 changes: 6 additions & 1 deletion web/packages/teleterm/build_resources/linux/after-remove.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ if [ "$1" = "upgrade" ] || [ "$1" = "1" ]; then
exit 0
fi

APP="/opt/${sanitizedProductName}"
BIN=/usr/local/bin
TSH_SYMLINK_TARGET=$BIN/tsh

# Remove the link to the Electron app binary.
rm -f "$BIN/${executable}"
if type update-alternatives >/dev/null 2>&1; then
update-alternatives --remove "${executable}" "$APP/${executable}"
else
rm -f "$BIN/${executable}"
fi

# At this point, the app has already been removed from disk. If TSH_SYMLINK_TARGET used to point at
# tsh bundled with the teleport-connect package, it is a broken symlink now.
Expand Down
7 changes: 6 additions & 1 deletion web/packages/teleterm/electron-builder-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,15 @@ module.exports = {
}

const path = `${packed.appOutDir}/Teleport Connect.app/Contents/MacOS/tsh.app/Contents/Info.plist`;
if (packed.appOutDir.endsWith('mac-universal--x64')) {
if (packed.appOutDir.endsWith('mac-universal-x64-temp')) {
tshAppPlist = fs.readFileSync(path);
}
if (packed.appOutDir.endsWith('mac-universal')) {
if (!tshAppPlist) {
throw new Error(
'Failed to copy tsh.app Info.plist file from the x64 build. Check if the path "mac-universal-x64-temp" was not changed by electron-builder.'
);
}
fs.writeFileSync(path, tshAppPlist);
}
},
Expand Down
3 changes: 1 addition & 2 deletions web/packages/teleterm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"@types/node-forge": "^1.0.4",
"clean-webpack-plugin": "4.0.0",
"cross-env": "5.0.5",
"electron": "22.3.6",
"electron-debug": "^3.2.0",
"electron": "24.3.0",
"electron-notarize": "^1.2.1",
"eslint-import-resolver-webpack": "0.13.2",
"eslint-loader": "3.0.3",
Expand Down
Loading