From ca4d4d08b7b480fb8196c8c295436481e442b48c Mon Sep 17 00:00:00 2001
From: Robert Patrick <robert.patrick@oracle.com>
Date: Fri, 12 Nov 2021 23:38:53 -0600
Subject: [PATCH] working around
 https://github.com/electron-userland/electron-builder/issues/6418

---
 electron/app/js/appUpdater.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/electron/app/js/appUpdater.js b/electron/app/js/appUpdater.js
index 4ae06941b..3fe666f67 100644
--- a/electron/app/js/appUpdater.js
+++ b/electron/app/js/appUpdater.js
@@ -11,6 +11,7 @@ const i18n = require('./i18next.config');
 const { getLogger } = require('./wktLogging');
 const errorUtils = require('./errorUtils');
 const { sendToWindow } = require('./windowUtils');
+const osUtils = require('./osUtils');
 
 let _isDevMode;
 let _downloadWindow;
@@ -34,6 +35,11 @@ function registerAutoUpdateListeners() {
     autoUpdater.logger.info('Download complete, install type: ' + _installType);
     // quit and install in this handler so MacOS updater can process the event first
     if(_installType === 'now') {
+      // Working around https://github.com/electron-userland/electron-builder/issues/6418
+      //
+      if (osUtils.isMac()) {
+        autoUpdater.autoInstallOnAppQuit = false;
+      }
       autoUpdater.quitAndInstall();
     }
   });