1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-08 19:44:06 +00:00

1. Updated installer to support --installPath on most all platforms

2. Updated installer, so if service already exists, and installPath isn't specified, it will try to use the existing path.
This commit is contained in:
Bryan Roe
2020-09-09 22:11:33 -07:00
parent cb364e8ec4
commit 80158d42ea
4 changed files with 201 additions and 177 deletions

View File

@@ -72,6 +72,23 @@ function installService(params)
options.parameters.splice(i, 1);
options.installInPlace = true;
}
if (global._workingpath != null && global._workingpath != '' && global._workingpath != '/')
{
for (i = 0; i < options.parameters.length; ++i)
{
if (options.parameters[i].startsWith('--installPath='))
{
global._workingpath = null;
break;
}
}
if(global._workingpath != null)
{
options.parameters.push('--installPath="' + global._workingpath + '"');
}
}
for (i = 0; i < options.parameters.length; ++i)
{
if(options.parameters[i].startsWith('--installPath='))
@@ -454,11 +471,14 @@ function fullInstall(jsonString)
console.setDestination(console.Destinations.DISABLED);
var parms = JSON.parse(jsonString);
var loc = null;
try
{
process.stdout.write('...Checking for previous installation');
var s = require('service-manager').manager.getService(process.platform == 'win32' ? 'Mesh Agent' : 'meshagent');
loc = s.appLocation();
global._workingpath = s.appWorkingDirectory();
s.close();
}
catch (e)