Skip to content

Commit 7db2520

Browse files
committed
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.
1 parent 8b244f0 commit 7db2520

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src-node/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extensionsIntegrated/appUpdater/update-electron.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,20 @@ define(function (require, exports, module) {
154154
/**
155155
* Check if we're at an upgradable location.
156156
* For Electron on Linux, we require the AppImage to be in ~/.phoenix-code/
157+
* (the path the installer.sh writes to).
157158
*/
158159
async function isUpgradableLocation() {
159160
try {
160-
const isPackaged = await window.electronAPI.isPackaged();
161-
if (!isPackaged) {
161+
const installedPath = await window.electronAPI.getInstalledAppPath();
162+
if (!installedPath) {
162163
return false;
163164
}
164-
const homeDir = await window.electronFSAPI.homeDir();
165+
let homeDir = await window.electronFSAPI.homeDir();
166+
if (!homeDir.endsWith("/")) {
167+
homeDir = homeDir + "/";
168+
}
165169
const phoenixInstallDir = `${homeDir}.phoenix-code/`;
166-
const execPath = await window.electronAPI.getExecutablePath();
167-
return execPath.startsWith(phoenixInstallDir);
170+
return installedPath.startsWith(phoenixInstallDir);
168171
} catch (e) {
169172
console.error(e);
170173
return false;

0 commit comments

Comments
 (0)