1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-02 16:43:28 +00:00

Added ability to set alternative fileName with installer

This commit is contained in:
Bryan Roe
2020-12-30 20:11:38 -08:00
parent f28e7b072b
commit 002fcb111c
3 changed files with 42 additions and 2 deletions

View File

@@ -4490,6 +4490,8 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
else if (installFlag != 0)
{
duk_context *ctxx = ILibDuktape_ScriptContainer_InitializeJavaScriptEngineEx(0, 0, agentHost->chain, NULL, NULL, agentHost->exePath, NULL, MeshAgent_AgentInstallerCTX_Finalizer, agentHost->chain);
ILibDuktape_MeshAgent_Init(ctxx, agentHost->chain, agentHost);
duk_eval_string(ctxx, "require('user-sessions').isRoot();");
if (!duk_get_boolean(ctxx, -1))
{

File diff suppressed because one or more lines are too long

View File

@@ -82,6 +82,17 @@ function checkParameters(parms)
if (parms.getParameter('description', null) == null && msh.description != null) { parms.push('--description="' + msh.description + '"'); }
if (parms.getParameter('displayName', null) == null && msh.displayName != null) { parms.push('--displayName="' + msh.displayName + '"'); }
if (parms.getParameter('companyName', null) == null && msh.companyName != null) { parms.push('--companyName="' + msh.companyName + '"'); }
if (msh.fileName != null)
{
var i = parms.getParameterIndex('fileName');
if(i>=0)
{
parms.splice(i, 1);
}
parms.push('--target="' + msh.fileName + '"');
}
if (parms.getParameter('meshServiceName', null) == null)
{
if(msh.meshServiceName != null)
@@ -111,6 +122,15 @@ function installService(params)
process.stdout.write('...Installing service');
console.info1('');
var target = null;
var targetx = params.getParameterIndex('target');
if (targetx >= 0)
{
target = params.getParameterValue(targetx);
params.splice(targetx, 1);
target = target.split(' ').join('');
}
var proxyFile = process.execPath;
if (process.platform == 'win32')
{
@@ -141,7 +161,7 @@ function installService(params)
var options =
{
name: params.getParameter('meshServiceName', process.platform == 'win32' ? 'Mesh Agent' : 'meshagent'),
target: process.platform == 'win32' ? 'MeshAgent' : 'meshagent',
target: target==null?(process.platform == 'win32' ? 'MeshAgent' : 'meshagent'):target,
servicePath: process.execPath,
startType: 'AUTO_START',
parameters: params,