From 2485372366139f4f6bec48ab61e98ea1b6375b18 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 24 Jun 2018 13:56:53 +0300 Subject: Machine Studio v 1.0.0.5 ! Forced update. Hashed passwords. --- .../ViewModels/LoadingViewVM.cs | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs index 5c8fb80ba..26be2d16b 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/LoadingViewVM.cs @@ -17,6 +17,8 @@ using Tango.MachineStudio.Common.EventLogging; using Tango.BL.Enumerations; using Tango.MachineStudio.UI.TFS; using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.Update; +using Tango.Core.DI; namespace Tango.MachineStudio.UI.ViewModels { @@ -75,6 +77,46 @@ namespace Tango.MachineStudio.UI.ViewModels { try { + try + { + LogManager.Log("Checking for forced update..."); + var service = UpdateServiceHelper.GetUpdateServiceChannel(); + var client = service.CreateChannel(); + + CheckForUpdatesResponse response = client.CheckForUpdates(new CheckForUpdatesRequest() + { + Email = "ForceUpdate", + Password = "ForceUpdate", + Version = ApplicationManager.Version, + }); + + if (response.IsUpdateAvailable && response.ForcedUpdate) + { + LogManager.Log("Forced update found, Navigating to update view!"); + + InvokeUI(() => + { + if (_notificationProvider.ShowQuestion("Machine Studio has detected a critical update which must be installed in order for the application to run properly. Do you wish to download and install this update?")) + { + TangoMessenger.Default.Send(new Messages.ForcedUpdateMessage() { UpdateResponse = response }); + _navigationManager.NavigateTo(NavigationView.UpdateView); + } + else + { + ApplicationManager.ShutDown(); + } + + IsLoading = false; + }); + + return; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error checking for forced update!"); + } + try { _tfs.Initialize(); -- cgit v1.3.1