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
18 changes: 17 additions & 1 deletion src-electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,28 @@ ipcMain.handle('is-packaged', (event) => {
return app.isPackaged;
});

// Get executable path (path to the AppImage on Linux)
// Path to the running Electron binary. On Linux AppImages this is the
// FUSE-mounted binary (/tmp/.mount_*/...), not the .AppImage file —
// use 'get-installed-app-path' if you need the user-visible install path.
ipcMain.handle('get-executable-path', (event) => {
assertTrusted(event);
return process.execPath;
});

// Path of the installed app, or null if not running from an installed build.
// - Linux AppImage: process.env.APPIMAGE (set by AppRun to the .AppImage path)
// - Other / dev / unpacked: null (auto-update not supported yet)
ipcMain.handle('get-installed-app-path', (event) => {
assertTrusted(event);
if (!app.isPackaged) {
return null;
}
if (process.platform === 'linux') {
return process.env.APPIMAGE || null;
}
return null;
});

// Update scheduled state - shared across windows for multi-window update persistence
ipcMain.handle('set-update-scheduled', (event, scheduled) => {
assertTrusted(event);
Expand Down
1 change: 1 addition & 0 deletions src-electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
isPackaged: () => ipcRenderer.invoke('is-packaged'),
getExecutablePath: () => ipcRenderer.invoke('get-executable-path'),
getInstalledAppPath: () => ipcRenderer.invoke('get-installed-app-path'),
setUpdateScheduled: (scheduled) => ipcRenderer.invoke('set-update-scheduled', scheduled),
getUpdateScheduled: () => ipcRenderer.invoke('get-update-scheduled')
});
Loading