mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 07:05:52 -05:00
allow multiple osx mpkg installs now and update uninstall.command
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
234acd3347
commit
c1bec67839
Binary file not shown.
35
webserver.js
35
webserver.js
@ -5844,9 +5844,11 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
||||
archive.on('error', function (err) { throw err; });
|
||||
|
||||
// Customize the mesh agent file name
|
||||
var meshfilename = 'MeshAgent-' + mesh.name + '.zip'
|
||||
var meshfilename = 'MeshAgent-' + mesh.name + '.zip';
|
||||
var meshexecutablename = 'meshagent';
|
||||
if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.filename == 'string')) {
|
||||
meshfilename = meshfilename.split('meshagent').join(domain.agentcustomization.filename).split('MeshAgent').join(domain.agentcustomization.filename);
|
||||
meshfilename = meshfilename.split('MeshAgent').join(domain.agentcustomization.filename);
|
||||
meshexecutablename = meshexecutablename.split('meshagent').join(domain.agentcustomization.filename);
|
||||
}
|
||||
|
||||
// Customise the mesh agent display name
|
||||
@ -5855,6 +5857,18 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
||||
meshdisplayname = meshdisplayname.split('Mesh Agent').join(domain.agentcustomization.displayname);
|
||||
}
|
||||
|
||||
// Customise the mesh agent service name
|
||||
var meshservicename = 'meshagent';
|
||||
if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.servicename == 'string')) {
|
||||
meshservicename = meshservicename.split('meshagent').join(domain.agentcustomization.servicename);
|
||||
}
|
||||
|
||||
// Customise the mesh agent company name
|
||||
var meshcompanyname = 'meshagent';
|
||||
if ((domain.agentcustomization != null) && (typeof domain.agentcustomization.companyname == 'string')) {
|
||||
meshcompanyname = meshcompanyname.split('meshagent').join(domain.agentcustomization.companyname);
|
||||
}
|
||||
|
||||
// Set the agent download including the mesh name.
|
||||
setContentDispositionHeader(res, 'application/octet-stream', meshfilename, null, 'MeshAgent.zip');
|
||||
archive.pipe(res);
|
||||
@ -5881,6 +5895,23 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF
|
||||
zipfile.readEntry();
|
||||
});
|
||||
});
|
||||
} else if (entry.fileName == 'MeshAgent.mpkg/Contents/Packages/internal.pkg/Contents/meshagent_osx64_LaunchAgent.plist' ||
|
||||
entry.fileName == 'MeshAgent.mpkg/Contents/Packages/internal.pkg/Contents/meshagent_osx64_LaunchDaemon.plist' ||
|
||||
entry.fileName == 'MeshAgent.mpkg/Contents/Packages/internal.pkg/Contents/Info.plist' ||
|
||||
entry.fileName == 'MeshAgent.mpkg/Contents/Packages/internal.pkg/Contents/Resources/postflight' ||
|
||||
entry.fileName == 'MeshAgent.mpkg/Contents/Packages/internal.pkg/Contents/Resources/Postflight.sh' ||
|
||||
entry.fileName == 'MeshAgent.mpkg/Uninstall.command') {
|
||||
// This is a special file entry, we need to fix it.
|
||||
zipfile.openReadStream(entry, function (err, readStream) {
|
||||
readStream.on('data', function (data) { if (readStream.xxdata) { readStream.xxdata += data; } else { readStream.xxdata = data; } });
|
||||
readStream.on('end', function () {
|
||||
var options = { name: entry.fileName };
|
||||
if (entry.fileName.endsWith('postflight') || entry.fileName.endsWith('Uninstall.command')) { options.mode = 493; }
|
||||
archive.append(readStream.xxdata.toString().split('###SERVICENAME###').join(meshservicename).split('###COMPANYNAME###').join(meshcompanyname).split('###EXECUTABLENAME###').join(meshexecutablename), options);
|
||||
zipfile.readEntry();
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
// Normal file entry
|
||||
zipfile.openReadStream(entry, function (err, readStream) {
|
||||
|
Loading…
Reference in New Issue
Block a user