From de9f8b3c51ea4603a7a31c34038ea459c8db90f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Climent?= Date: Fri, 19 Jul 2024 23:38:44 +0200 Subject: [PATCH] fix WinGet packages specifying versions when they should be doing so (fix #2506) --- src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs b/src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs index fe38f6792..9498f0c47 100644 --- a/src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs +++ b/src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs @@ -253,15 +253,11 @@ public override string[] GetUninstallParameters(Package package, InstallationOpt } ); - if (options.Version != "") + if (!package.IsUpgradable && options.Version != "") { parameters.AddRange(["--version", $"\"{options.Version}\"", "--force"]); } - else if (package.IsUpgradable && package.NewVersion != "") - { - parameters.AddRange(["--version", $"\"{package.NewVersion}\""]); - } - else if (package.Version != "Unknown") + else if (!package.IsUpgradable && package.Version != "Unknown") { parameters.AddRange(["--version", $"\"{package.Version}\""]); }