From 3757e7d35121af81c4167a10a800bea6fb52f422 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Fri, 29 Jan 2016 08:33:44 -0600 Subject: [PATCH] (GH-584) Reinstall should use available package The information contained in the available package may have pertinent information that the installed package does not have, such as whether it is approved or not, or whether there is a cached download available. Use the available package for performing the reinstall versus the existing package. This also may fix other issues, like when a package has been corrected while it is still under moderation and/or while a maintainer is repeatedly testing a package. --- src/chocolatey/infrastructure.app/services/NugetService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 7f7819627f..b37f76c4ae 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -418,7 +418,7 @@ public ConcurrentDictionary install_run(ChocolateyConfigu if (installedPackage != null && (installedPackage.Version == availablePackage.Version) && config.Force) { - var forcedResult = packageInstalls.GetOrAdd(packageName, new PackageResult(installedPackage, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id))); + var forcedResult = packageInstalls.GetOrAdd(packageName, new PackageResult(availablePackage, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, availablePackage.Id))); forcedResult.Messages.Add(new ResultMessage(ResultType.Note, "Backing up and removing old version")); backup_existing_version(config, installedPackage, _packageInfoService.get_package_information(installedPackage));