From 09612156e05b1e44b315714e979b936897b63a91 Mon Sep 17 00:00:00 2001 From: elynagh Date: Tue, 4 Jun 2019 18:26:39 -0400 Subject: [PATCH] Fix how to handle killing processes in Windows Uncommented Windows killStr (2) and adjusted windows-all-closed to only run when on MacOS (145). --- main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index e92ebf21d3..0eee863cc8 100644 --- a/main.js +++ b/main.js @@ -19,7 +19,7 @@ var execPath = "RScript" if(process.platform == WINDOWS){ - //killStr = "taskkill /im Rscript.exe /f" + killStr = "taskkill /im Rscript.exe /f" appPath = appPath.replace(/\\/g, "\\\\"); execPath = path.join(app.getAppPath(), "R-Portable-Win", "bin", "RScript.exe" ) } else if(process.platform == MACOS){ @@ -143,11 +143,12 @@ app.on('ready', createWindow) // Quit when all windows are closed. app.on('window-all-closed', function () { - console.log('EVENT::window-all-closed') - // On OS X it is common for applications and their menu bar - // to stay active until the user quits explicitly with Cmd + Q - cleanUpApplication() - + if(process.platform==MACOS){ + console.log('EVENT::window-all-closed') + // On OS X it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + cleanUpApplication() + } }) app.on('activate', function () {