mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-11-26 07:57:56 +03:00
Windows hashing fix for MeshAssistant.
This commit is contained in:
parent
3cb606fcad
commit
db03a0959e
Binary file not shown.
@ -2401,13 +2401,30 @@ function CreateMeshCentralServer(config, args) {
|
||||
// List of possible mesh agent install scripts
|
||||
var meshToolsList = {
|
||||
'MeshCentralRouter': { localname: 'MeshCentralRouter.exe', dlname: 'winrouter' },
|
||||
'MeshCentralAssistant': { localname: 'MeshCentralAssistant.exe', dlname: 'winassistant' }
|
||||
'MeshCentralAssistant': { localname: 'MeshCentralAssistant.exe', dlname: 'winassistant', winhash: true }
|
||||
//'MeshCentralRouterMacOS': { localname: 'MeshCentralRouter.dmg', dlname: 'MeshCentralRouter.dmg' }
|
||||
};
|
||||
|
||||
// Update the list of available mesh agents
|
||||
obj.updateMeshTools = function () {
|
||||
for (var toolname in meshToolsList) {
|
||||
if (meshToolsList[toolname].winhash === true) {
|
||||
var toolpath = obj.path.join(__dirname, 'agents', meshToolsList[toolname].localname);
|
||||
var hashStream = obj.crypto.createHash('sha384');
|
||||
hashStream.toolname = toolname;
|
||||
hashStream.toolpath = toolpath;
|
||||
hashStream.dlname = meshToolsList[toolname].dlname;
|
||||
hashStream.hashx = 0;
|
||||
hashStream.on('data', function (data) {
|
||||
obj.meshToolsBinaries[this.toolname] = { hash: data.toString('hex'), hashx: this.hashx, path: this.toolpath, dlname: this.dlname, url: this.url };
|
||||
obj.meshToolsBinaries[this.toolname].url = 'https://' + obj.certificates.CommonName + ':' + ((typeof obj.args.aliasport == 'number') ? obj.args.aliasport : obj.args.port) + '/meshagents?meshaction=' + this.dlname;
|
||||
var stats = null;
|
||||
try { stats = obj.fs.statSync(this.toolpath); } catch (e) { }
|
||||
if (stats != null) { obj.meshToolsBinaries[this.toolname].size = stats.size; }
|
||||
});
|
||||
var options = { sourcePath: toolpath, targetStream: hashStream };
|
||||
obj.exeHandler.hashExecutableFile(options);
|
||||
} else {
|
||||
var toolpath = obj.path.join(__dirname, 'agents', meshToolsList[toolname].localname);
|
||||
var stream = null;
|
||||
try {
|
||||
@ -2436,6 +2453,7 @@ function CreateMeshCentralServer(config, args) {
|
||||
stream.hashx = 0;
|
||||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// List of possible mesh agent install scripts
|
||||
|
Loading…
Reference in New Issue
Block a user