diff --git a/src/main/autoUpdate.js b/src/main/autoUpdate.js index 7ca3e078..5f4cd20e 100644 --- a/src/main/autoUpdate.js +++ b/src/main/autoUpdate.js @@ -1,5 +1,6 @@ // @flow +import { app, BrowserWindow } from 'electron' import { autoUpdater } from 'electron-updater' type SendFunction = (type: string, data: *) => void @@ -16,5 +17,14 @@ export default (notify: SendFunction) => { } export function quitAndInstall() { - autoUpdater.quitAndInstall() + setImmediate(() => { + const browserWindows = BrowserWindow.getAllWindows() + + app.removeAllListeners('window-all-closed') + browserWindows.forEach(browserWindow => { + browserWindow.removeAllListeners('close') + }) + + autoUpdater.quitAndInstall(false) + }) }