sdk/test/Microsoft.DotNet.PackageIns...
Caio Granero 4a4823d8b9
Avoid reinstall tool already installed (#41746)
Fixes #40818

Context

Following the changes introduced in #37311, the dotnet tool install --global command began reinstalling tools that were already installed, which involved deleting and then adding the same tool version again. Before this release, it was not possible to install a version that was already installed.

This behavior change was reported in #40818. I propose a modification to avoid reinstalling tools that are already installed.

Change

The current installation flow involves uninstalling all matching tools and then installing them again. My change modifies this flow by first checking if the requested best match package version is already installed. If it is, the flow is stopped, and a message is printed: 'Tool '{0}' is already installed'.
2024-06-27 13:19:45 -07:00
..
SampleGlobalTool Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
SampleGlobalToolWithDifferentCasing Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
SampleGlobalToolWithPreview Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
SampleGlobalToolWithShim Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
DotnetToolSettingsGolden.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
DotnetToolSettingsMajorHigherVersion.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
DotnetToolSettingsMalformed.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
DotnetToolSettingsMissing.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
DotnetToolSettingsMissingVersion.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
LocalToolsResolverCacheTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
LockFileMatcherTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
Microsoft.DotNet.PackageInstall.Tests.csproj Don't run PackageInstall test targets when the project is excluded (#39079) 2024-02-28 09:57:11 +00:00
MockFirstPartyNuGetPackageSigningVerifier.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
NuGetPackageInstallerExtractTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
NuGetPackageInstallerTests.cs Merge branch 'release/8.0.3xx' 2024-02-07 22:14:11 -08:00
Stage2ProjectRestorer.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
ToolConfigurationDeserializerTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
ToolPackageDownloaderTests.cs Avoid reinstall tool already installed (#41746) 2024-06-27 13:19:45 -07:00
ToolPackageInstallerNugetCacheTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
ToolPackageUninstallerTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
UnixFilePermissionsSample.xml Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00
UnixFilePermissionsTests.cs Moved the contents of src/Tests to test. 2023-11-22 16:02:27 -08:00