Fixed MeshCore.js for 32bit Windows.
Ylian Saint-Hilaire committed
Jan 22, 2020 at 17:15 UTC
1fafbc6cf2e92aa43082464e0ba6866ed7f421a5
2 files changed
+11
-7
agents/meshcore.js
+10
-6
@@ -42,14 +42,18 @@ function createMeshCore(agent) {
42
if (process.platform == 'win32' && require('user-sessions').isRoot())
43
{
44
// Check the Agent Uninstall MetaData for correctness, as the installer may have written an incorrect value
45
- var writtenSize = 0, actualSize = Math.floor(require('fs').statSync(process.execPath).size / 1024);
46
- try { writtenSize = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize'); } catch (x) { }
47
- if (writtenSize != actualSize) { try { require('win-registry').WriteKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize', actualSize); } catch (x2) { } }
45
+ try {
46
+ var writtenSize = 0, actualSize = Math.floor(require('fs').statSync(process.execPath).size / 1024);
47
+ try { writtenSize = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize'); } catch (x) { }
48
+ if (writtenSize != actualSize) { try { require('win-registry').WriteKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize', actualSize); } catch (x2) { } }
49
+ } catch (ex) { }
50
51
// Check to see if we are the Installed Mesh Agent Service, if we are, make sure we can run in Safe Mode
50
- var meshCheck = false;
51
- try { meshCheck = require('service-manager').manager.getService('Mesh Agent').isMe(); } catch (mce) { }
52
- if (meshCheck && require('win-bcd').isSafeModeService && !require('win-bcd').isSafeModeService('Mesh Agent')) { require('win-bcd').enableSafeModeService('Mesh Agent'); }
52
+ try {
53
+ var meshCheck = false;
54
+ try { meshCheck = require('service-manager').manager.getService('Mesh Agent').isMe(); } catch (mce) { }
55
+ if (meshCheck && require('win-bcd').isSafeModeService && !require('win-bcd').isSafeModeService('Mesh Agent')) { require('win-bcd').enableSafeModeService('Mesh Agent'); }
56
+ } catch (ex) { }
57
}
58
59
if (process.platform == 'darwin' && !process.versions) {
package.json
+1
-1
@@ -1,6 +1,6 @@
1
{
2
"name": "meshcentral",
3
- "version": "0.4.7-m",
3
+ "version": "0.4.7-o",
4
"keywords": [
5
"Remote Management",
6
"Intel AMT",