Skip to content

Commit

Permalink
(GH-861) Fix uninstall to use version parameter
Browse files Browse the repository at this point in the history
Previously when executing an uninstall of a specific version of a
package which was side-by-side installed, Chocolatey would always
uninstall the latest package.

This fix will change the NugetService.uninstall_run to actually
use the version when selecting the package to remove.
  • Loading branch information
tmsns authored and ferventcoder committed Aug 3, 2016
1 parent e73dace commit e9ecf80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ public ConcurrentDictionary<string, PackageResult> uninstall_run(ChocolateyConfi
}
else
{
IPackage installedPackage = packageManager.LocalRepository.FindPackage(packageName);
if (installedPackage != null) installedPackageVersions.Add(installedPackage);
SemanticVersion semanticVersion = new SemanticVersion(config.Version);
installedPackageVersions = packageManager.LocalRepository.FindPackagesById(packageName).Where((p) => p.Version.Equals(semanticVersion)).ToList();
}

if (installedPackageVersions.Count == 0)
Expand Down

0 comments on commit e9ecf80

Please sign in to comment.