From 374770da20d9cad0fd00e26bf0f864cd71010b07 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Fri, 27 Jun 2025 09:26:13 +0000 Subject: [PATCH] Fix auto-updater error dialog in Electron AppImage --- electron/src/index.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/electron/src/index.ts b/electron/src/index.ts index 3a44468e..5992d36d 100644 --- a/electron/src/index.ts +++ b/electron/src/index.ts @@ -62,6 +62,12 @@ if (electronIsDev) { setupReloadWatcher(myCapacitorApp); } +// Configure auto-updater +autoUpdater.on('error', (error) => { + console.log('Auto-updater error (suppressed):', error.message); + // Don't show error dialogs for update check failures +}); + // Run Application (async () => { // Wait for electron app to be ready. @@ -70,8 +76,15 @@ if (electronIsDev) { setupContentSecurityPolicy(myCapacitorApp.getCustomURLScheme()); // Initialize our app, build windows, and load content. await myCapacitorApp.init(); - // Check for updates if we are in a packaged app. - autoUpdater.checkForUpdatesAndNotify(); + + // Only check for updates in production builds, not in development or AppImage + if (!electronIsDev && !process.env.APPIMAGE) { + try { + autoUpdater.checkForUpdatesAndNotify(); + } catch (error) { + console.log('Update check failed (suppressed):', error); + } + } })(); // Handle when all of our windows are close (platforms have their own expectations).