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. --- Software/Visual_Studio/PPC/Tango.PPC.UI/App.config | 80 ---------------------- .../Connectivity/DefaultConnectivityProvider.cs | 1 - .../PPCApplication/DefaultPPCApplicationManager.cs | 29 +++++++- .../PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs | 2 +- .../Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs | 8 +-- .../Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs | 10 ++- .../Visual_Studio/PPC/Tango.PPC.UI/app.manifest | 2 +- 7 files changed, 36 insertions(+), 96 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config index 15a7107bd..ea49af905 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/App.config @@ -11,86 +11,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs index 5fc7f00df..e7aff7357 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Connectivity/DefaultConnectivityProvider.cs @@ -17,7 +17,6 @@ using Tango.PPC.Common.Application; using Tango.PPC.Common.Connection; using Tango.PPC.Common.Connectivity; using Tango.PPC.Common.Notifications; -using Tango.PPC.Common.Scripting; using Tango.Settings; using Tango.WiFi; 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. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index fa54f491e..b7c1f4eff 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.0.6.0")] +[assembly: AssemblyVersion("1.0.3.0")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs index 1bd1e1eea..aca9dbcf7 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineSetupViewVM.cs @@ -282,13 +282,9 @@ namespace Tango.PPC.UI.ViewModels /// private void CompleteSetup() { - String updater_exe = Path.Combine(_setup_result.UpdatePackagePath, "Tango.PPC.Updater.exe"); - LogManager.Log("Completing machine setup..."); - LogManager.Log($"Executing '{updater_exe}' with arguments '{PathHelper.GetStartupPath()}'..."); - Process.Start(updater_exe, PathHelper.GetStartupPath()); - LogManager.Log("Terminating application process!"); - _appManager.ShutDown(); + String updater_exe = Path.Combine(_setup_result.UpdatePackagePath, "Tango.PPC.Updater.exe"); + _appManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath()); } /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs index 6046f0300..b5b5f56bc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs @@ -194,7 +194,7 @@ namespace Tango.PPC.UI.ViewModels try { - await MachineUpdateManager.UpdateDB(_db_compare_result); + await MachineUpdateManager.UpdateDB(_db_compare_result, MachineProvider.Machine.SerialNumber); LogManager.Log("Database update completed."); await NavigateTo(MachineUpdateView.UpdateCompletedView); } @@ -213,14 +213,12 @@ namespace Tango.PPC.UI.ViewModels private void CompleteUpdate() { + LogManager.Log("Completing machine update..."); + if (!IsDbUpdate) { String updater_exe = Path.Combine(_update_result.UpdatePackagePath, "Tango.PPC.Updater.exe"); - LogManager.Log("Completing machine setup..."); - LogManager.Log($"Executing '{updater_exe}' with arguments '{PathHelper.GetStartupPath()}'..."); - Process.Start(updater_exe, PathHelper.GetStartupPath()); - LogManager.Log("Terminating application process!"); - ApplicationManager.ShutDown(); + ApplicationManager.UpdateApplication(updater_exe, PathHelper.GetStartupPath()); } else { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index efc5f8179..d72e75011 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + -- cgit v1.3.1