From 81b5909e920ab5f409a9b8310e7f3216b5f3a398 Mon Sep 17 00:00:00 2001 From: si458 Date: Mon, 19 Aug 2024 12:53:43 +0100 Subject: [PATCH] dont start service after install winservice.js Signed-off-by: si458 --- winservice.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winservice.js b/winservice.js index ce78beaa..64af559c 100644 --- a/winservice.js +++ b/winservice.js @@ -50,7 +50,7 @@ function start() { var env = [], xenv = ['user', 'port', 'aliasport', 'mpsport', 'mpsaliasport', 'redirport', 'exactport', 'debug']; for (var i in xenv) { if (args[xenv[i]] != null) { env.push({ name: 'mesh' + xenv[i], value: args[xenv[i]] }); } } // Set some args as service environement variables. var svc = new service({ name: 'MeshCentral', description: 'MeshCentral Remote Management Server', script: path.join(__dirname, 'winservice.js'), env: env, wait: 2, grow: 0.5 }); - svc.on('install', function () { console.log('MeshCentral service installed.'); setTimeout(function(){ svc.start(); }, 1000); }); + svc.on('install', function () { console.log('MeshCentral service installed.'); setTimeout(function(){ process.exit(); }, 1000); }); svc.on('uninstall', function () { console.log('MeshCentral service uninstalled.'); setTimeout(function(){ process.exit(); }, 1000); }); svc.on('start', function () { console.log('MeshCentral service started.'); setTimeout(function(){ process.exit(); }, 1000); }); svc.on('stop', function () { console.log('MeshCentral service stopped.'); if (args.stop) { setTimeout(function(){ process.exit(); }, 1000); } if (args.restart) { console.log('Holding 5 seconds...'); setTimeout(function () { svc.start(); }, 5000); } });