From 4783a653de4655b24b811347c06ee6be912f9f33 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 8 Jun 2021 13:31:46 -0700 Subject: [PATCH] Removed device group name in file when Assistant is monitoring only. --- webserver.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/webserver.js b/webserver.js index 865d2924..cabbfb5b 100644 --- a/webserver.js +++ b/webserver.js @@ -4636,8 +4636,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { // Customize the mesh agent file name if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.filename == 'string')) { - meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename); - meshfilename = meshfilename.split('MeshAgent').join(domain.agentcustomization.filename); + meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename).split('MeshAgent').join(domain.agentcustomization.filename); } // Get the agent connection server name @@ -4667,7 +4666,13 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) { if (typeof domain.assistantcustomization.image == 'string') { try { meshsettings += 'Image=' + Buffer.from(obj.fs.readFileSync(parent.getConfigFilePath(domain.assistantcustomization.image)), 'binary').toString('base64') + '\r\n'; } catch (ex) { console.log(ex); } } - if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = meshfilename.split('MeshCentralAssistant').join(domain.assistantcustomization.filename); } + if (req.query.ac != '4') { + // Send with custom filename followed by device group name + if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = meshfilename.split('MeshCentralAssistant').join(domain.assistantcustomization.filename); } + } else { + // Send with custom filename, no device group name + if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = domain.assistantcustomization.filename + '.exe'; } else { meshfilename = 'MeshCentralAssistant.exe'; } + } } } else { // Add agent customization, not for Assistant if (domain.agentcustomization != null) {