mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-09 04:38:07 -05:00
Added Uninstall/MetaData check for windows
This commit is contained in:
parent
1134dd2f7c
commit
be2b52432e
@ -39,6 +39,29 @@ var MESHRIGHT_LIMITEDINPUT = 4096;
|
|||||||
|
|
||||||
function createMeshCore(agent) {
|
function createMeshCore(agent) {
|
||||||
var obj = {};
|
var obj = {};
|
||||||
|
if (process.platform == 'win32' && require('user-sessions').isRoot())
|
||||||
|
{
|
||||||
|
// Check the Agent Uninstall MetaData for correctness, as the installer may have written an incorrect value
|
||||||
|
var actualSize = require('fs').statSync(process.execPath).size / 1024;
|
||||||
|
var writtenSize = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
writtenSize = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize');
|
||||||
|
}
|
||||||
|
catch(x)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (writtenSize != actualSize)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
require('win-registry').WriteKey(require('win-registry').HKEY.LocalMachine, 'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MeshCentralAgent', 'EstimatedSize', actualSize);
|
||||||
|
}
|
||||||
|
catch (x2)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform == 'darwin' && !process.versions) {
|
if (process.platform == 'darwin' && !process.versions) {
|
||||||
// This is an older MacOS Agent, so we'll need to check the service definition so that Auto-Update will function correctly
|
// This is an older MacOS Agent, so we'll need to check the service definition so that Auto-Update will function correctly
|
||||||
|
Loading…
x
Reference in New Issue
Block a user