Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(updater): simplify Windows update install by using silent mode and removing redundant before-quit handling

Gabriel Stein0cc1a16b2005
diff --git a/src/updater.js b/src/updater.js
index e509e3eca..625a66923 100644
--- a/src/updater.js
+++ b/src/updater.js
@@ -10,7 +10,6 @@ class UpdateManager {
this.lastUpdateInfo = null;
this.isInstalling = false;
this.isDownloading = false;
- this.installTimeout = null;
this.ipcHandlers = [];
this.eventListeners = [];
@@ -234,33 +233,14 @@ class UpdateManager {
this.isInstalling = true;
console.log("πŸ”„ Installing update and restarting...");
- this.installTimeout = setTimeout(() => {
- console.log("πŸ”„ Calling quitAndInstall(false, true)...");
- console.log("πŸ“Š Platform:", process.platform);
- console.log("πŸ“Š Update downloaded:", this.updateDownloaded);
-
- // CRITICAL: Emit before-quit BEFORE quitAndInstall closes windows
- // This sets isQuitting=true in windowManager, allowing windows to close
- const { app } = require("electron");
- app.emit("before-quit");
-
- // Now quitAndInstall will:
- // 1. Close all windows (now allowed because isQuitting = true)
- // 2. Emit 'before-quit' event again (harmless)
- // 3. Call app.quit()
- // 4. Install update and restart (if isForceRunAfter = true)
- autoUpdater.quitAndInstall(false, true);
-
- console.log("βœ… quitAndInstall() called - app should be quitting...");
- }, 100);
+ // quitAndInstall handles everything: closes windows, emits before-quit, then installs
+ // isSilent=true on Windows for cleaner UX, isForceRunAfter=true to restart app
+ const isSilent = process.platform === "win32";
+ autoUpdater.quitAndInstall(isSilent, true);
return { success: true, message: "Update installation started" };
} catch (error) {
this.isInstalling = false;
- if (this.installTimeout) {
- clearTimeout(this.installTimeout);
- this.installTimeout = null;
- }
console.error("❌ Update installation error:", error);
throw error;
}
@@ -328,12 +308,6 @@ class UpdateManager {
// Cleanup method to be called on app quit
cleanup() {
- // Clear timeout
- if (this.installTimeout) {
- clearTimeout(this.installTimeout);
- this.installTimeout = null;
- }
-
// Remove event listeners
this.eventListeners.forEach(({ event, handler }) => {
autoUpdater.removeListener(event, handler);