Removed device group name in file when Assistant is monitoring only.

Ylian Saint-Hilaire committed Jun 8, 2021 at 13:31 UTC 4783a653de4655b24b811347c06ee6be912f9f33
1 file changed +8 -3
webserver.js
+8 -3
@@ -4636,8 +4636,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
4636
4637 // Customize the mesh agent file name
4638 if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.filename == 'string')) {
4639 - meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename);
4640 - meshfilename = meshfilename.split('MeshAgent').join(domain.agentcustomization.filename);
4639 + meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename).split('MeshAgent').join(domain.agentcustomization.filename);
4640 }
4641
4642 // Get the agent connection server name
@@ -4667,7 +4666,13 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
4666 if (typeof domain.assistantcustomization.image == 'string') {
4667 try { meshsettings += 'Image=' + Buffer.from(obj.fs.readFileSync(parent.getConfigFilePath(domain.assistantcustomization.image)), 'binary').toString('base64') + '\r\n'; } catch (ex) { console.log(ex); }
4668 }
4670 - if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = meshfilename.split('MeshCentralAssistant').join(domain.assistantcustomization.filename); }
4669 + if (req.query.ac != '4') {
4670 + // Send with custom filename followed by device group name
4671 + if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = meshfilename.split('MeshCentralAssistant').join(domain.assistantcustomization.filename); }
4672 + } else {
4673 + // Send with custom filename, no device group name
4674 + if (typeof domain.assistantcustomization.filename == 'string') { meshfilename = domain.assistantcustomization.filename + '.exe'; } else { meshfilename = 'MeshCentralAssistant.exe'; }
4675 + }
4676 }
4677 } else { // Add agent customization, not for Assistant
4678 if (domain.agentcustomization != null) {