From 37369f0b6c31a36054bcd811a7097a4e4b64decc Mon Sep 17 00:00:00 2001 From: tangb Date: Tue, 13 Mar 2018 12:53:09 +0100 Subject: [PATCH] Fix for windows --- cleepdesktop.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/cleepdesktop.js b/cleepdesktop.js index 065baab..cc95935 100644 --- a/cleepdesktop.js +++ b/cleepdesktop.js @@ -358,17 +358,31 @@ function launchCore(rpcport) if( !isDev ) { - //launch release + //launch release mode logger.debug('Launch release mode'); - let commandline = path.join(__dirname + '.unpacked/', 'cleepdesktopcore/cleepdesktopcore'); + + //prepare command line + let commandline = path.join(__dirname + '.unpacked/', 'cleepdesktopcore/'); logger.info('cmdline with asar: ' + commandline); if( !require('fs').existsSync(commandline) ) { - commandline = path.join(__dirname, 'cleepdesktopcore/cleepdesktopcore'); + commandline = path.join(__dirname, 'cleepdesktopcore/'); logger.info('cmdline without asar: ' + commandline); } + + //append bin name + if( process.platform=='win32' ) + { + commandline = path.join(commandline, 'cleepdesktopcore.exe'); + } + else + { + commandline = path.join(commandline, 'cleepdesktopcore'); + } + + //launch command line let debug = settings.has('cleep.debug') && settings.get('cleep.debug') ? 'debug' : 'release'; - logger.debug('Core commandline: '+commandline+' ' + rpcport + ' ' + configPath + ' ' + configFilename + ' ' + debug); + logger.info('Core commandline: '+commandline+' ' + rpcport + ' ' + configPath + ' ' + configFilename + ' ' + debug); coreProcess = require('child_process').spawn(commandline, [rpcport, configPath, configFilename, 'release', 'false']); } else