From 5bf9aa811de89ad6da27b60f8a44c57ee6207b27 Mon Sep 17 00:00:00 2001 From: rafael-aero Date: Tue, 2 Nov 2021 18:20:59 +0100 Subject: [PATCH] Update main.js --- ElectronNET.Host/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ElectronNET.Host/main.js b/ElectronNET.Host/main.js index 9e66277..29041b0 100644 --- a/ElectronNET.Host/main.js +++ b/ElectronNET.Host/main.js @@ -246,7 +246,7 @@ function startSocketApiBridge(port) { io.on('connection', (socket) => { socket.on('disconnect', function (reason) { - console.log('Got disconnect! Reason: ' + reason); + console.log('Socket with .NET disconnect with reason: ' + reason); try { if (hostHook) { const hostHookScriptFilePath = path.join(__dirname, 'ElectronHostHook', 'index.js'); @@ -404,6 +404,11 @@ function startAspCoreBackend(electronPort) { console.log(`Will quit Electron, as exit code != 0 (got ${code})`); app.exit(code); } + else if (os.platform() === 'darwin' && ignoreApiProcessClosed) { + //There is a bug on the updater on macOS never quiting and starting the update process + //We give Squirrel.Mac enough time to access the update file, and then just force-exit here + setTimeout(() => app.exit(0), 10_000); + } }); if (detachedProcess) {