Fixed MeshCentral server update on Windows.

Ylian Saint-Hilaire committed Dec 22, 2019 at 12:44 UTC 19f1296385fffe4a2ed366a5017a766c149321c9
3 files changed +4 -4
meshcentral.js
+2 -2
@@ -232,7 +232,7 @@ function CreateMeshCentralServer(config, args) {
232 var child_process = require('child_process');
233 var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
234 var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
235 - var env = {};
235 + var env = Object.assign({}, process.env); // Shallow clone
236 if (typeof obj.args.npmproxy == 'string') { env['HTTP_PROXY'] = env['HTTPS_PROXY'] = env['http_proxy'] = env['https_proxy'] = obj.args.npmproxy; }
237 var xxprocess = child_process.exec(npmpath + ' install meshcentral' + version + npmproxy, { maxBuffer: Infinity, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { });
238 xxprocess.data = '';
@@ -282,7 +282,7 @@ function CreateMeshCentralServer(config, args) {
282 var child_process = require('child_process');
283 var npmpath = ((typeof obj.args.npmpath == 'string') ? obj.args.npmpath : 'npm');
284 var npmproxy = ((typeof obj.args.npmproxy == 'string') ? (' --proxy ' + obj.args.npmproxy) : '');
285 - var env = {};
285 + var env = Object.assign({}, process.env); // Shallow clone
286 if (typeof obj.args.npmproxy == 'string') { env['HTTP_PROXY'] = env['HTTPS_PROXY'] = env['http_proxy'] = env['https_proxy'] = obj.args.npmproxy; }
287 var xxprocess = child_process.exec(npmpath + npmproxy + ' view meshcentral dist-tags.latest', { maxBuffer: 512000, cwd: obj.parentpath, env: env }, function (error, stdout, stderr) { });
288 xxprocess.data = '';
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.4.6-i",
3 + "version": "0.4.6-j",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
webserver.js
+1 -1
@@ -2930,7 +2930,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2930 archive.on('error', function (err) { throw err; });
2931
2932 // Set the archive name
2933 - res.attachment((domain.title ? domain.title : "Meshcentral") + '-Backup-' + new Date().toLocaleDateString().replace('/', '-').replace('/', '-') + '.zip');
2933 + res.attachment((domain.title ? domain.title : 'MeshCentral') + '-Backup-' + new Date().toLocaleDateString().replace('/', '-').replace('/', '-') + '.zip');
2934
2935 // Pipe archive data to the file
2936 archive.pipe(res);