From c9330d1fcf1aa405efc936eb4b1217a03010f841 Mon Sep 17 00:00:00 2001 From: abose Date: Sun, 17 May 2026 10:01:29 +0530 Subject: [PATCH] fix(updater): detect installed AppImage path on Linux isUpgradableLocation() was comparing the FUSE-mounted Electron binary path (process.execPath, e.g. /tmp/.mount_*/phoenix-code) against ~/.phoenix-code/, which never matched. Switch to the new electronAPI.getInstalledAppPath() which returns process.env.APPIMAGE on packaged AppImage runs (and null elsewhere), so the upgradable-location check actually passes for installed builds. Also ensure homeDir has a trailing slash, matching the Tauri-side check. Also sync src-node/package-lock.json to 5.1.17. --- src-node/package-lock.json | 4 ++-- .../appUpdater/update-electron.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src-node/package-lock.json b/src-node/package-lock.json index 4466b57831..c8dc2833b2 100644 --- a/src-node/package-lock.json +++ b/src-node/package-lock.json @@ -1,12 +1,12 @@ { "name": "@phcode/node-core", - "version": "5.1.16-0", + "version": "5.1.17-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@phcode/node-core", - "version": "5.1.16-0", + "version": "5.1.17-0", "hasInstallScript": true, "license": "GNU-AGPL3.0", "dependencies": { diff --git a/src/extensionsIntegrated/appUpdater/update-electron.js b/src/extensionsIntegrated/appUpdater/update-electron.js index ccea096480..5fe98907ff 100644 --- a/src/extensionsIntegrated/appUpdater/update-electron.js +++ b/src/extensionsIntegrated/appUpdater/update-electron.js @@ -154,17 +154,20 @@ define(function (require, exports, module) { /** * Check if we're at an upgradable location. * For Electron on Linux, we require the AppImage to be in ~/.phoenix-code/ + * (the path the installer.sh writes to). */ async function isUpgradableLocation() { try { - const isPackaged = await window.electronAPI.isPackaged(); - if (!isPackaged) { + const installedPath = await window.electronAPI.getInstalledAppPath(); + if (!installedPath) { return false; } - const homeDir = await window.electronFSAPI.homeDir(); + let homeDir = await window.electronFSAPI.homeDir(); + if (!homeDir.endsWith("/")) { + homeDir = homeDir + "/"; + } const phoenixInstallDir = `${homeDir}.phoenix-code/`; - const execPath = await window.electronAPI.getExecutablePath(); - return execPath.startsWith(phoenixInstallDir); + return installedPath.startsWith(phoenixInstallDir); } catch (e) { console.error(e); return false;