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;