Fixed issues with update detection.
This fixes a case where the update checker keeps an old reference to the previous updated version, despite running a newer version. It also removes some use of `Assembly.GetExecutingAssembly().GetName().Version` with the information from `UpdaterManager.SelfVersion.Version` as that should follow the update info. This fixes #5698 This fixes #5252
This commit is contained in:
@@ -25,6 +25,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Duplicati.Library.AutoUpdater;
|
||||
using Duplicati.Library.Common.IO;
|
||||
using Duplicati.Library.Crashlog;
|
||||
using Duplicati.Library.Encryption;
|
||||
@@ -555,6 +556,23 @@ namespace Duplicati.Server
|
||||
{
|
||||
throw new UserInformationException(Strings.Program.InvalidTimezone(commandlineOptions[WebServerLoader.OPTION_WEBSERVICE_TIMEZONE]), "InvalidTimeZone", ex);
|
||||
}
|
||||
|
||||
// The database has recorded a new version
|
||||
if (DataConnection.ApplicationSettings.UpdatedVersion != null)
|
||||
{
|
||||
// Check if the running version is newer than the recorded version
|
||||
if (UpdaterManager.TryParseVersion(DataConnection.ApplicationSettings.UpdatedVersion.Version) <= UpdaterManager.TryParseVersion(UpdaterManager.SelfVersion.Version))
|
||||
{
|
||||
// Clean up lingering update notifications
|
||||
var updateNotifications = DataConnection.GetNotifications().Where(x => x.Action == "update:new").ToList();
|
||||
foreach (var n in updateNotifications)
|
||||
DataConnection.DismissNotification(n.ID);
|
||||
|
||||
// Clear up the recorded version
|
||||
DataConnection.ApplicationSettings.UpdatedVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void CreateApplicationInstance(bool writeToConsoleOnExceptionw)
|
||||
|
||||
Reference in New Issue
Block a user