Merge pull request #847 from nvella/master

UpdateManager: don't update if update is older than currently running version (fixes #838)
This commit is contained in:
Nick Vella 2019-08-08 00:23:38 +10:00 committed by GitHub
commit c7bb28dbc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -42,6 +42,17 @@ namespace OpenLiveWriter.PostEditor.Updates
{
using (var manager = new Squirrel.UpdateManager(downloadUrl))
{
var update = await manager.CheckForUpdate();
if(update != null &&
update.ReleasesToApply.Count > 0 &&
update.FutureReleaseEntry.Version < update.CurrentlyInstalledVersion.Version)
{
Trace.WriteLine("Update is older than currently running version, not installing.");
Trace.WriteLine($"Current: {update.CurrentlyInstalledVersion.Version} Update: {update.FutureReleaseEntry.Version}");
return;
}
await manager.UpdateApp();
}
}