Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/UniGetUI.PackageEngine.Operations/PackageOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ public UpdatePackageOperation(
bool IgnoreParallelInstalls = false,
AbstractOperation? req = null)
: base(package, options, OperationType.Update, IgnoreParallelInstalls, req)
{ }
{
}

protected override Task HandleFailure()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static bool NewerVersionIsInstalled(Package other)
{
foreach (Package found in __installed_pkgs.Values)
{
if (found.IsEquivalentTo(other) && found.NormalizedVersion == other.NormalizedNewVersion)
if (found.IsEquivalentTo(other) && found.NormalizedVersion >= other.NormalizedNewVersion)
{
return true;
}
Expand Down
11 changes: 11 additions & 0 deletions src/UniGetUI/AppOperationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ public static void Install(IReadOnlyList<IPackage> packages, TEL_InstallReferral
public static async Task<AbstractOperation?> Update(IPackage? package, bool? elevated = null, bool? interactive = null, bool? no_integrity = null, bool ignoreParallel = false, AbstractOperation? req = null)
{
if (package is null) return null;
if (package.NewerVersionIsInstalled())
{
Logger.Warn($"A newer version of {package.Id} has been detected, the update will not be performed!");
PEInterface.UpgradablePackagesLoader.Remove(package);
foreach (var eq in PEInterface.InstalledPackagesLoader.GetEquivalentPackages(package))
{ // Remove upgradable tag from all installed packages
eq.Tag = PackageTag.Default;
}

return null;
}

var options = await InstallOptionsFactory.LoadApplicableAsync(package, elevated, interactive, no_integrity);
var operation = new UpdatePackageOperation(package, options, ignoreParallel, req);
Expand Down
Loading