diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-24 19:04:47 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-02-24 19:04:47 +0200 |
| commit | 40746c60fed9e70f3cb7f6f12f55595a77a1adfa (patch) | |
| tree | 815a77a25888aceed48d15a9ce2f977e0d9ee845 /Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication | |
| parent | 64b768178dc9e64293a52c1b6d2631709af9502a (diff) | |
| download | Tango-40746c60fed9e70f3cb7f6f12f55595a77a1adfa.tar.gz Tango-40746c60fed9e70f3cb7f6f12f55595a77a1adfa.zip | |
Fixed PPC and Machine Studio issues before next release.
Started working on Advanced Installer libraries.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs | 29 |
1 files changed, 28 insertions, 1 deletions
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) { @@ -381,6 +381,33 @@ namespace Tango.PPC.UI.PPCApplication } /// <summary> + /// Runs the updater utility and exits the application. + /// </summary> + public void UpdateApplication(String updaterPath, String arguments) + { + if (IsShuttingDown) return; + + IsShuttingDown = true; + + try + { + _watchdogServer.Dispose(); + + foreach (var vm in TangoIOC.Default.GetAllInstancesByBase<PPCViewModel>()) + { + vm.OnApplicationShuttingDown(); + } + } + catch { } + + LogManager.Log($"Executing '{updaterPath}' with arguments '{arguments}'..."); + Process.Start(updaterPath, arguments); + + LogManager.Log("Terminating application..."); + Environment.Exit(0); + } + + /// <summary> /// Enteres the application technician mode. /// </summary> public void EnterTechnicianMode() |
