From 40746c60fed9e70f3cb7f6f12f55595a77a1adfa Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Feb 2019 19:04:47 +0200 Subject: Fixed PPC and Machine Studio issues before next release. Started working on Advanced Installer libraries. --- .../PPCApplication/DefaultPPCApplicationManager.cs | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index 4b5874907..f7711318f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -161,7 +161,7 @@ namespace Tango.PPC.UI.PPCApplication //Start watchdog _watchdogServer = new WatchDogServer(Application.Current.Dispatcher); -#if RELEASE +#if !DEBUG if (settings.EnableWatchDog) { @@ -380,6 +380,33 @@ namespace Tango.PPC.UI.PPCApplication Environment.Exit(0); } + /// + /// Runs the updater utility and exits the application. + /// + public void UpdateApplication(String updaterPath, String arguments) + { + if (IsShuttingDown) return; + + IsShuttingDown = true; + + try + { + _watchdogServer.Dispose(); + + foreach (var vm in TangoIOC.Default.GetAllInstancesByBase()) + { + vm.OnApplicationShuttingDown(); + } + } + catch { } + + LogManager.Log($"Executing '{updaterPath}' with arguments '{arguments}'..."); + Process.Start(updaterPath, arguments); + + LogManager.Log("Terminating application..."); + Environment.Exit(0); + } + /// /// Enteres the application technician mode. /// -- cgit v1.3.1