Browse Source

Fix auto-updater error dialog in Electron AppImage

streamline-attempt
Matthew Raymer 1 week ago
parent
commit
374770da20
  1. 17
      electron/src/index.ts

17
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).

Loading…
Cancel
Save