summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-03-12 16:19:53 +0000
committersr55 <[email protected]>2016-03-12 16:20:22 +0000
commit39613ae76e39b5a8ddaae50aa5d5665796acc726 (patch)
tree5f07ea0e79de1929e2e73037ee9f23fa9d634d91 /win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
parent1a972f68a412ae06b000930a189bb06bcb5ba6e6 (diff)
WinGui: Add SHA1 Verification of the update downloads and don't start the installer if the hash check fails.
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 3176070d0..69df5a635 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -1124,7 +1124,7 @@ namespace HandBrakeWPF.ViewModels
public void DownloadUpdate()
{
this.UpdateMessage = "Preparing for Update ...";
- this.updateService.DownloadFile(this.updateInfo.DownloadFile, this.DownloadComplete, this.DownloadProgress);
+ this.updateService.DownloadFile(this.updateInfo.DownloadFile, this.updateInfo.ExpectedSHA1Hash, this.DownloadComplete, this.DownloadProgress);
}
/// <summary>
@@ -1412,10 +1412,13 @@ namespace HandBrakeWPF.ViewModels
private void DownloadComplete(DownloadStatus info)
{
this.UpdateAvailable = false;
- this.UpdateMessage = info.WasSuccessful ? Resources.OptionsViewModel_UpdateDownloaded : Resources.OptionsViewModel_UpdateFailed;
+ this.UpdateMessage = info.WasSuccessful ? Resources.OptionsViewModel_UpdateDownloaded : info.Message;
- Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
- Execute.OnUIThread(() => Application.Current.Shutdown());
+ if (info.WasSuccessful)
+ {
+ Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
+ Execute.OnUIThread(() => Application.Current.Shutdown());
+ }
}
/// <summary>