@@ -225,6 +225,45 @@ ipcMain.on('send-health-metric', (event, payload) => {
225225 }
226226} ) ;
227227
228+ /**
229+ * App updater IPC handlers
230+ * These provide low-level APIs for the update-electron.js extension in Phoenix
231+ */
232+
233+ // Get app version from config
234+ ipcMain . handle ( 'get-app-version' , ( event ) => {
235+ assertTrusted ( event ) ;
236+ return version ;
237+ } ) ;
238+
239+ // Check if app is packaged (production build)
240+ ipcMain . handle ( 'is-packaged' , ( event ) => {
241+ assertTrusted ( event ) ;
242+ return app . isPackaged ;
243+ } ) ;
244+
245+ // Get executable path (path to the AppImage on Linux)
246+ ipcMain . handle ( 'get-executable-path' , ( event ) => {
247+ assertTrusted ( event ) ;
248+ return process . execPath ;
249+ } ) ;
250+
251+ // Run a shell command for update script execution
252+ ipcMain . handle ( 'run-shell-command' , async ( event , command ) => {
253+ assertTrusted ( event ) ;
254+ const { exec } = require ( 'child_process' ) ;
255+ return new Promise ( ( resolve ) => {
256+ exec ( command , { shell : '/bin/bash' } , ( error , stdout , stderr ) => {
257+ if ( error ) {
258+ console . error ( 'Shell command error:' , error ) ;
259+ resolve ( { code : error . code || 1 , stdout, stderr } ) ;
260+ } else {
261+ resolve ( { code : 0 , stdout, stderr } ) ;
262+ }
263+ } ) ;
264+ } ) ;
265+ } ) ;
266+
228267// Handle quit request from renderer
229268app . on ( 'quit-requested' , ( exitCode ) => {
230269 gracefulShutdown ( exitCode ) ;
0 commit comments