mirror of
https://github.com/Ylianst/MeshCentralRouter
synced 2025-12-06 00:13:33 +00:00
Added -noupdate switch.
This commit is contained in:
@@ -49,6 +49,7 @@ namespace MeshCentralRouter
|
||||
public bool forceExit = false;
|
||||
public bool sendEmailToken = false;
|
||||
public bool sendSMSToken = false;
|
||||
public bool allowUpdates = true;
|
||||
public Uri authLoginUrl = null;
|
||||
public Process installProcess = null;
|
||||
public string acceptableCertHash = null;
|
||||
@@ -229,6 +230,7 @@ namespace MeshCentralRouter
|
||||
if (arg.ToLower() == "-oldstyle") { deviceListViewMode = false; }
|
||||
if (arg.ToLower() == "-install") { hookRouter(); forceExit = true; return; }
|
||||
if (arg.ToLower() == "-uninstall") { unHookRouter(); forceExit = true; return; }
|
||||
if (arg.ToLower() == "-noupdate") { allowUpdates = false; return; }
|
||||
if (arg.ToLower() == "-debug") { debug = true; }
|
||||
if (arg.ToLower() == "-tlsdump") { tlsdump = true; }
|
||||
if (arg.ToLower() == "-ignorecert") { ignoreCert = true; }
|
||||
@@ -554,7 +556,7 @@ namespace MeshCentralRouter
|
||||
meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged;
|
||||
meshcentral.onClipboardData += Meshcentral_onClipboardData;
|
||||
meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie;
|
||||
//meshcentral.onToolUpdate += Meshcentral_onToolUpdate;
|
||||
if (allowUpdates) { meshcentral.onToolUpdate += Meshcentral_onToolUpdate; }
|
||||
if (lastBadConnectCert != null)
|
||||
{
|
||||
meshcentral.okCertHash = lastBadConnectCert.GetCertHashString();
|
||||
@@ -632,7 +634,7 @@ namespace MeshCentralRouter
|
||||
meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged;
|
||||
meshcentral.onClipboardData += Meshcentral_onClipboardData;
|
||||
meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie;
|
||||
meshcentral.onToolUpdate += Meshcentral_onToolUpdate;
|
||||
if (allowUpdates) { meshcentral.onToolUpdate += Meshcentral_onToolUpdate; }
|
||||
meshcentral.okCertHash = lastBadConnectCert.GetCertHashString();
|
||||
|
||||
Uri serverurl = null;
|
||||
@@ -1405,7 +1407,7 @@ namespace MeshCentralRouter
|
||||
meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged;
|
||||
meshcentral.onClipboardData += Meshcentral_onClipboardData;
|
||||
meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie;
|
||||
meshcentral.onToolUpdate += Meshcentral_onToolUpdate;
|
||||
if (allowUpdates) { meshcentral.onToolUpdate += Meshcentral_onToolUpdate; }
|
||||
if (sendEmailToken == true)
|
||||
{
|
||||
sendEmailToken = false;
|
||||
|
||||
2407
src/MainForm.resx
2407
src/MainForm.resx
File diff suppressed because it is too large
Load Diff
@@ -262,7 +262,7 @@ namespace MeshCentralRouter
|
||||
wc.SendString("{\"action\":\"nodes\"}");
|
||||
wc.SendString("{\"action\":\"authcookie\"}");
|
||||
wc.SendString("{\"action\":\"logincookie\"}");
|
||||
wc.SendString("{\"action\":\"meshToolInfo\",\"name\":\"MeshCentralRouter\"}");
|
||||
if (onToolUpdate != null) { wc.SendString("{\"action\":\"meshToolInfo\",\"name\":\"MeshCentralRouter\"}"); }
|
||||
break;
|
||||
}
|
||||
case "authcookie":
|
||||
@@ -708,7 +708,10 @@ namespace MeshCentralRouter
|
||||
if (jsonAction.ContainsKey("serverhash")) { serverhash = jsonAction["serverhash"].ToString(); }
|
||||
|
||||
// If the hashes don't match, event the tool update with URL
|
||||
if (selfExecutableHashHex != hash) { onToolUpdate((string)url, (string)jsonAction["hash"], (int)jsonAction["size"], serverhash); }
|
||||
if (selfExecutableHashHex != hash) {
|
||||
if (debug) { try { File.AppendAllText("debug.log", "Self-executable hash mismatch, update available.\r\n"); } catch (Exception) { } }
|
||||
onToolUpdate((string)url, (string)jsonAction["hash"], (int)jsonAction["size"], serverhash);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user