Added Windows7 support

Ylian Saint-Hilaire committed Jul 26, 2018 at 16:31 UTC d8a955629be00ba8acfa4549fdd1f49e609b0409
9 files changed +8 -44
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/MeshService-signed.exe
Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ
agents/MeshService.exe
Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ
agents/MeshService64-signed.exe
Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ
agents/MeshService64.exe
Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ
agents/meshcore.js
+2 -42
@@ -423,7 +423,6 @@ function createMeshCore(agent) {
423 // List all the drives in the root, or the root itself
424 var results = null;
425 try { results = fs.readDrivesSync(); } catch (e) { } // TODO: Anyway to get drive total size and free space? Could draw a progress bar.
426 - //console.log('a', objToString(results, 0, ' '));
426 if (results != null) {
427 for (var i = 0; i < results.length; ++i) {
428 var drive = { n: results[i].name, t: 1 };
@@ -435,11 +434,13 @@ function createMeshCore(agent) {
434 // List all the files and folders in this path
435 if (reqpath == '') { reqpath = '/'; }
436 var results = null, xpath = obj.path.join(reqpath, '*');
437 + //if (process.platform == "win32") { xpath = xpath.split('/').join('\\'); }
438 try { results = fs.readdirSync(xpath); } catch (e) { }
439 if (results != null) {
440 for (var i = 0; i < results.length; ++i) {
441 if ((results[i] != '.') && (results[i] != '..')) {
442 var stat = null, p = obj.path.join(reqpath, results[i]);
443 + //if (process.platform == "win32") { p = p.split('/').join('\\'); }
444 try { stat = fs.statSync(p); } catch (e) { } // TODO: Get file size/date
445 if ((stat != null) && (stat != undefined)) {
446 if (stat.isDirectory() == true) {
@@ -1478,47 +1479,6 @@ function createMeshCore(agent) {
1479 }
1480 };
1481
1481 - // Get a formated response for a given directory path
1482 - obj.getDirectoryInfo = function(reqpath) {
1483 - var response = { path: reqpath, dir: [] };
1484 - if (((reqpath == undefined) || (reqpath == '')) && (process.platform == 'win32')) {
1485 - // List all the drives in the root, or the root itself
1486 - var results = null;
1487 - try { results = fs.readDrivesSync(); } catch (e) { sendConsoleText(e); } // TODO: Anyway to get drive total size and free space? Could draw a progress bar.
1488 - //console.log('a', objToString(results, 0, ' '));
1489 - if (results != null) {
1490 - for (var i = 0; i < results.length; ++i) {
1491 - var drive = { n: results[i].name, t: 1 };
1492 - if (results[i].type == 'REMOVABLE') { drive.dt = 'removable'; } // TODO: See if this is USB/CDROM or something else, we can draw icons.
1493 - response.dir.push(drive);
1494 - }
1495 - }
1496 - } else {
1497 - // List all the files and folders in this path
1498 - if (reqpath == '') { reqpath = '/'; }
1499 - var xpath = path.join(reqpath, '*');
1500 - var results = null;
1501 -
1502 - try { results = fs.readdirSync(xpath); } catch (e) { sendConsoleText(e); }
1503 - if (results != null) {
1504 - for (var i = 0; i < results.length; ++i) {
1505 - if ((results[i] != '.') && (results[i] != '..')) {
1506 - var stat = null, p = path.join(reqpath, results[i]);
1507 - try { stat = fs.statSync(p); } catch (e) { } // TODO: Get file size/date
1508 - if ((stat != null) && (stat != undefined)) {
1509 - if (stat.isDirectory() == true) {
1510 - response.dir.push({ n: results[i], t: 2, d: stat.mtime });
1511 - } else {
1512 - response.dir.push({ n: results[i], t: 3, s: stat.size, d: stat.mtime });
1513 - }
1514 - }
1515 - }
1516 - }
1517 - }
1518 - }
1519 - return response;
1520 - }
1521 -
1482 // Process KVM control channel data
1483 obj.kvmCtrlData = function(channel, cmd) {
1484 if (cmd.length > 0 && cmd.charCodeAt(0) != 123) {
mpsserver.js
+5 -1
@@ -630,7 +630,11 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
630 // This function writes data to this CIRA channel
631 cirachannel.write = function (data) {
632 if (cirachannel.state == 0) return false;
633 - if (cirachannel.state == 1 || cirachannel.sendcredits == 0 || cirachannel.sendBuffer != undefined) { if (cirachannel.sendBuffer == undefined) { cirachannel.sendBuffer = data; } else { cirachannel.sendBuffer += data; } return; }
633 + if (cirachannel.state == 1 || cirachannel.sendcredits == 0 || cirachannel.sendBuffer != undefined) {
634 + // Channel is connected, but we are out of credits. Add the data to the outbound buffer.
635 + if (cirachannel.sendBuffer == undefined) { cirachannel.sendBuffer = data; } else { cirachannel.sendBuffer += data; }
636 + return true;
637 + }
638 // Compute how much data we can send
639 if (data.length <= cirachannel.sendcredits) {
640 // Send the entire message
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.1.8-y",
3 + "version": "0.1.9-b",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",