diff --git a/src/MainForm.cs b/src/MainForm.cs index 159a6e9..45e4904 100644 --- a/src/MainForm.cs +++ b/src/MainForm.cs @@ -679,7 +679,8 @@ namespace MeshCentralRouter { if (this.InvokeRequired) { this.Invoke(new MeshCentralServer.toolUpdateHandler(Meshcentral_onToolUpdate), url, hash, size, serverhash); return; } UpdateForm f = new UpdateForm(url, hash, size, args, serverhash); - if (f.ShowDialog(this) == DialogResult.OK) { } + forceExit = true; + if (f.ShowDialog(this) != DialogResult.OK) { forceExit = !notifyIcon.Visible; } } private void Meshcentral_onLoginTokenChanged() diff --git a/src/UpdateForm.cs b/src/UpdateForm.cs index 5629b8c..5c3753f 100644 --- a/src/UpdateForm.cs +++ b/src/UpdateForm.cs @@ -140,7 +140,8 @@ namespace MeshCentralRouter } else { updateMessage(Translate.T(Properties.Resources.Updating), 0); Process.Start(System.Reflection.Assembly.GetEntryAssembly().Location + ".update.exe", "-update:" + System.Reflection.Assembly.GetEntryAssembly().Location + " " + string.Join(" ", args)); - Application.Exit(); + + if (this.InvokeRequired) { this.Invoke((MethodInvoker)delegate { Application.Exit(); }); } else { Application.Exit(); } } } }