aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs27
1 files changed, 26 insertions, 1 deletions
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 f582d0bb0..fc1de5de1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineUpdateViewVM.cs
@@ -10,6 +10,7 @@ using Tango.Core.Helpers;
using Tango.Explorer;
using Tango.PPC.Common;
using Tango.PPC.Common.MachineUpdate;
+using Tango.PPC.UI.Dialogs;
using Tango.PPC.UI.ViewsContracts;
namespace Tango.PPC.UI.ViewModels
@@ -246,7 +247,31 @@ namespace Tango.PPC.UI.ViewModels
private async void HandleSoftwareUpdatePackageLoaded(ExplorerFileItem fileItem)
{
- if (await NotificationProvider.ShowQuestion("Do you with to install the selected software package?"))
+ UpdatePackageFile packageFile = null;
+
+ try
+ {
+ packageFile = await MachineUpdateManager.GetUpdatePackageFileInfo(fileItem.Path);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error loading update package file from {fileItem.Path}.");
+ await NotificationProvider.ShowError("An error occurred while trying to load the selected software update package. Please make sure the package is valid.");
+ return;
+ }
+
+ if (ApplicationManager.Version <= packageFile.Version)
+ {
+ await NotificationProvider.ShowError($"The selected update package (v{packageFile.Version.ToString()}) contains an older software version.");
+ return;
+ }
+
+ UpdateFromFileViewVM vm = new UpdateFromFileViewVM();
+ vm.Version = packageFile.Version.ToString();
+
+ await NotificationProvider.ShowDialog(vm);
+
+ if (vm.DialogResult)
{
await NavigationManager.NavigateTo(Common.Navigation.NavigationView.MachineUpdateView);
await NavigateTo(MachineUpdateView.UpdateFromPackageView);