File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,12 +253,28 @@ ipcMain.handle('is-packaged', (event) => {
253253 return app . isPackaged ;
254254} ) ;
255255
256- // Get executable path (path to the AppImage on Linux)
256+ // Path to the running Electron binary. On Linux AppImages this is the
257+ // FUSE-mounted binary (/tmp/.mount_*/...), not the .AppImage file —
258+ // use 'get-installed-app-path' if you need the user-visible install path.
257259ipcMain . handle ( 'get-executable-path' , ( event ) => {
258260 assertTrusted ( event ) ;
259261 return process . execPath ;
260262} ) ;
261263
264+ // Path of the installed app, or null if not running from an installed build.
265+ // - Linux AppImage: process.env.APPIMAGE (set by AppRun to the .AppImage path)
266+ // - Other / dev / unpacked: null (auto-update not supported yet)
267+ ipcMain . handle ( 'get-installed-app-path' , ( event ) => {
268+ assertTrusted ( event ) ;
269+ if ( ! app . isPackaged ) {
270+ return null ;
271+ }
272+ if ( process . platform === 'linux' ) {
273+ return process . env . APPIMAGE || null ;
274+ }
275+ return null ;
276+ } ) ;
277+
262278// Update scheduled state - shared across windows for multi-window update persistence
263279ipcMain . handle ( 'set-update-scheduled' , ( event , scheduled ) => {
264280 assertTrusted ( event ) ;
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
173173 getAppVersion : ( ) => ipcRenderer . invoke ( 'get-app-version' ) ,
174174 isPackaged : ( ) => ipcRenderer . invoke ( 'is-packaged' ) ,
175175 getExecutablePath : ( ) => ipcRenderer . invoke ( 'get-executable-path' ) ,
176+ getInstalledAppPath : ( ) => ipcRenderer . invoke ( 'get-installed-app-path' ) ,
176177 setUpdateScheduled : ( scheduled ) => ipcRenderer . invoke ( 'set-update-scheduled' , scheduled ) ,
177178 getUpdateScheduled : ( ) => ipcRenderer . invoke ( 'get-update-scheduled' )
178179} ) ;
You can’t perform that action at this time.
0 commit comments