From a29a64213d6e71733b953cdf2b6d9d6475ec334b Mon Sep 17 00:00:00 2001 From: Rain Sallow Date: Thu, 16 Mar 2023 16:48:26 -0400 Subject: [PATCH] (#2788) Remove deprecated side by side installs Removing deprecated feature for v2. --- .../helpers/ChocolateyTabExpansion.ps1 | 4 +- src/chocolatey.tests.integration/Scenario.cs | 6 +- .../context/testing.packages.config | 2 +- .../scenarios/InstallScenarios.cs | 505 ------------------ .../scenarios/UpgradeScenarios.cs | 14 +- src/chocolatey.tests/TinySpec.cs | 9 - .../commands/ChocolateyInstallCommandSpecs.cs | 12 - .../commands/ChocolateyUpgradeCommandSpecs.cs | 12 - .../commands/ChocolateyInstallCommand.cs | 23 +- .../commands/ChocolateyUninstallCommand.cs | 4 - .../commands/ChocolateyUpgradeCommand.cs | 7 - .../PackagesConfigFilePackageSetting.cs | 3 - .../domain/ChocolateyPackageInformation.cs | 3 - .../nuget/ChocolateyPackagePathResolver.cs | 13 +- .../infrastructure.app/nuget/NugetCommon.cs | 6 +- .../ChocolateyPackageInformationService.cs | 25 +- .../services/ChocolateyPackageService.cs | 16 - .../services/NugetService.cs | 46 +- .../commands/choco-info.Tests.ps1 | 18 - .../commands/choco-install.Tests.ps1 | 2 +- .../commands/choco-uninstall.Tests.ps1 | 30 -- 21 files changed, 44 insertions(+), 716 deletions(-) diff --git a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 index b147604df..28d7345ac 100644 --- a/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 +++ b/src/chocolatey.resources/helpers/ChocolateyTabExpansion.ps1 @@ -53,10 +53,10 @@ $commandOptions = @{ list = "--lo --id-only --pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user='' --password='' --local-only --prerelease --include-programs --page='' --page-size='' --order-by-popularity --download-cache-only --disable-package-repository-optimizations" + $proListOptions + $allcommands search = "--pre --exact --by-id-only --id-starts-with --detailed --approved-only --not-broken --source='' --user='' --password='' --local-only --prerelease --include-programs --page='' --page-size='' --order-by-popularity --download-cache-only --disable-package-repository-optimizations" + $proListOptions + $allcommands info = "--pre --lo --source='' --user='' --password='' --local-only --prerelease --disable-package-repository-optimizations" + $proInfoOptions + $allcommands - install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --allow-multiple-versions --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --stop-on-first-package-failure --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $allcommands + install = "-y -whatif -? --pre --version= --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --force-dependencies --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --stop-on-first-package-failure --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $allcommands pin = "--name='' --version='' -?" + $proPinOptions + $allcommands outdated = "-? --source='' --user='' --password='' --ignore-pinned --ignore-unfound --pre --prerelease --disable-package-repository-optimizations" + $proOutdatedOptions + $allcommands - upgrade = "-y -whatif -? --pre --version='' --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --allow-multiple-versions --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --exclude-prerelease --stop-on-first-package-failure --use-remembered-options --ignore-remembered-options --skip-when-not-installed --install-if-not-installed --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $proUpgradeOptions + $allcommands + upgrade = "-y -whatif -? --pre --version='' --except='' --params='' --install-arguments='' --override-arguments --ignore-dependencies --source='' --source='windowsfeatures' --user='' --password='' --prerelease --forcex86 --not-silent --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --allow-downgrade --require-checksums --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --fail-on-unfound --fail-on-not-installed --ignore-checksums --allow-empty-checksums --allow-empty-checksums-secure --download-checksum='' --download-checksum-type='' --download-checksum-x64='' --download-checksum-type-x64='' --exclude-prerelease --stop-on-first-package-failure --use-remembered-options --ignore-remembered-options --skip-when-not-installed --install-if-not-installed --disable-package-repository-optimizations --pin" + $proInstallUpgradeOptions + $proUpgradeOptions + $allcommands uninstall = "-y -whatif -? --force-dependencies --remove-dependencies --all-versions --source='windowsfeatures' --version= --uninstall-arguments='' --override-arguments --not-silent --params='' --package-parameters='' --exit-when-reboot-detected --ignore-detected-reboot --use-package-exit-codes --ignore-package-exit-codes --skip-automation-scripts --use-autouninstaller --skip-autouninstaller --fail-on-autouninstaller --ignore-autouninstaller-failure --stop-on-first-package-failure" + $proUninstallOptions + $allcommands new = "--template-name='' --output-directory='' --automaticpackage --version='' --maintainer='' packageversion='' maintainername='' maintainerrepo='' installertype='' url='' url64='' silentargs='' --use-built-in-template -?" + $proNewOptions + $allcommands pack = "--version='' --output-directory='' -?" + $allcommands diff --git a/src/chocolatey.tests.integration/Scenario.cs b/src/chocolatey.tests.integration/Scenario.cs index d26d3cc9f..ff0fc0a0b 100644 --- a/src/chocolatey.tests.integration/Scenario.cs +++ b/src/chocolatey.tests.integration/Scenario.cs @@ -209,6 +209,11 @@ public static void create_directory(string directoryPath) _fileSystem.create_directory(directoryPath); } + public static void move_directory(string path, string newPath) + { + _fileSystem.move_directory(path, newPath); + } + public static void add_changed_version_package_to_source_location(ChocolateyConfiguration config, string pattern, string newVersion) { _fileSystem.create_directory_if_not_exists(config.Sources); @@ -278,7 +283,6 @@ private static ChocolateyConfiguration baseline_configuration() config.Information.IsProcessElevated = true; config.Information.IsLicensedVersion = false; config.AcceptLicense = true; - config.AllowMultipleVersions = false; config.AllowUnofficialBuild = true; config.CacheLocation = _fileSystem.get_full_path(_fileSystem.combine_paths(get_top_level(), "cache")); config.CommandExecutionTimeoutSeconds = 2700; diff --git a/src/chocolatey.tests.integration/context/testing.packages.config b/src/chocolatey.tests.integration/context/testing.packages.config index b5abd7bb7..7d55e7a3c 100644 --- a/src/chocolatey.tests.integration/context/testing.packages.config +++ b/src/chocolatey.tests.integration/context/testing.packages.config @@ -5,7 +5,7 @@ \ No newline at end of file diff --git a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs index 98a825d1b..8e3b83ea7 100644 --- a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -1432,511 +1432,6 @@ public void should_have_expected_error_in_package_result() } } - [Categories.SideBySide] - public class when_installing_a_side_by_side_package : ScenariosBase - { - private PackageResult packageResult; - - public override void Context() - { - base.Context(); - Configuration.AllowMultipleVersions = true; - } - - public override void Because() - { - Results = Service.install_run(Configuration); - packageResult = Results.FirstOrDefault().Value; - } - - [Fact] - public void should_install_where_install_location_reports() - { - DirectoryAssert.Exists(packageResult.InstallLocation); - } - - [Fact] - public void should_install_a_package_in_the_lib_directory() - { - var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames) + ".1.0.0"; - - DirectoryAssert.Exists(packageDir); - } - - [Fact] - public void should_put_version_in_nupkg_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.PackageExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact, Pending("Will be removed together with side by side removal"), Broken] - public void should_put_version_in_nuspec_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.ManifestExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact] - public void should_not_have_nupkg_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + NuGetConstants.PackageExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact, Pending("Broken, will be removed together with side by side install"), Broken] - public void should_not_have_nuspec_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + NuGetConstants.ManifestExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact] - public void should_contain_a_warning_message_that_it_installed_successfully() - { - bool installedSuccessfully = false; - foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) - { - if (message.Contains("1/1")) installedSuccessfully = true; - } - - installedSuccessfully.ShouldBeTrue(); - } - - [Fact] - public void should_contain_a_warning_message_that_installing_package_with_multiple_versions_being_deprecated() - { - const string expected = "Installing the same package with multiple versions is deprecated and will be removed in v2.0.0."; - - foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) - { - if (message.Contains(expected)) - { - return; - } - } - - Assert.Fail("No warning message about side by side deprecation outputted"); - } - - [Fact] - public void should_have_a_successful_package_result() - { - packageResult.Success.ShouldBeTrue(); - } - - [Fact] - public void should_not_have_inconclusive_package_result() - { - packageResult.Inconclusive.ShouldBeFalse(); - } - - [Fact] - public void should_not_have_warning_package_result() - { - packageResult.Warning.ShouldBeFalse(); - } - - [Fact] - public void config_should_match_package_result_name() - { - packageResult.Name.ShouldEqual(Configuration.PackageNames); - } - - [Fact] - public void should_have_a_version_of_one_dot_zero_dot_zero() - { - packageResult.Version.ShouldEqual("1.0.0"); - } - } - - [Categories.SideBySide] - public class when_switching_a_normal_package_to_a_side_by_side_package : ScenariosBase - { - private PackageResult packageResult; - - public override void Context() - { - base.Context(); - Scenario.install_package(Configuration, "installpackage", "1.0.0"); - Configuration.AllowMultipleVersions = true; - Configuration.Force = true; - } - - public override void Because() - { - Results = Service.install_run(Configuration); - packageResult = Results.FirstOrDefault().Value; - } - - [Fact] - public void should_install_where_install_location_reports() - { - DirectoryAssert.Exists(packageResult.InstallLocation); - } - - [Fact] - public void should_install_a_package_in_the_lib_directory() - { - var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames) + ".1.0.0"; - - DirectoryAssert.Exists(packageDir); - } - - [Fact] - public void should_put_version_in_nupkg_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.PackageExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact, Pending("Should be removed together with side by side installation"), Broken] - public void should_put_version_in_nuspec_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.ManifestExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact] - public void should_not_have_nupkg_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + NuGetConstants.PackageExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact, Pending("Should be removed together with side by side installation"), Broken] - public void should_not_have_nuspec_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.0.0"), - (Configuration.PackageNames + NuGetConstants.ManifestExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact] - public void should_contain_a_warning_message_that_it_installed_successfully() - { - bool installedSuccessfully = false; - foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) - { - if (message.Contains("1/1")) installedSuccessfully = true; - } - - installedSuccessfully.ShouldBeTrue(); - } - - [Fact] - public void should_have_a_successful_package_result() - { - packageResult.Success.ShouldBeTrue(); - } - - [Fact] - public void should_not_have_inconclusive_package_result() - { - packageResult.Inconclusive.ShouldBeFalse(); - } - - [Fact] - public void should_not_have_warning_package_result() - { - packageResult.Warning.ShouldBeFalse(); - } - - [Fact] - public void config_should_match_package_result_name() - { - packageResult.Name.ShouldEqual(Configuration.PackageNames); - } - - [Fact] - public void should_have_a_version_of_one_dot_zero_dot_zero() - { - packageResult.Version.ShouldEqual("1.0.0"); - } - } - - [Categories.SideBySide] - public class when_installing_an_older_version_side_by_side_with_a_newer_version : ScenariosBase - { - private PackageResult packageResult; - - public override void Context() - { - base.Context(); - Configuration.PackageNames = Configuration.Input = "isdependency"; - Scenario.add_packages_to_source_location(Configuration, Configuration.Input + "*" + NuGetConstants.PackageExtension); - Scenario.install_package(Configuration, "isdependency", "2.0.0"); - Configuration.AllowMultipleVersions = true; - Configuration.Version = "1.1.0"; - } - - public override void Because() - { - Results = Service.install_run(Configuration); - packageResult = Results.FirstOrDefault().Value; - } - - [Fact] - public void should_install_where_install_location_reports() - { - DirectoryAssert.Exists(packageResult.InstallLocation); - } - - [Fact] - public void should_install_a_package_in_the_lib_directory() - { - var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames) + ".1.1.0"; - - DirectoryAssert.Exists(packageDir); - } - - [Fact] - public void should_put_version_in_nupkg_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.1.0"), - (Configuration.PackageNames + ".1.1.0" + NuGetConstants.PackageExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact, Pending("Should be removed together with side by side installation"), Broken] - public void should_put_version_in_nuspec_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.1.0"), - (Configuration.PackageNames + ".1.1.0" + NuGetConstants.ManifestExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact] - public void should_not_have_nupkg_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.1.0"), - (Configuration.PackageNames + NuGetConstants.PackageExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact, Pending("Should be removed together with side by side installation"), Broken] - public void should_not_have_nuspec_without_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - (Configuration.PackageNames + ".1.1.0"), - (Configuration.PackageNames + NuGetConstants.ManifestExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact] - public void should_contain_a_warning_message_that_it_installed_successfully() - { - bool installedSuccessfully = false; - foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) - { - if (message.Contains("1/1")) installedSuccessfully = true; - } - - installedSuccessfully.ShouldBeTrue(); - } - - [Fact] - public void should_have_a_successful_package_result() - { - packageResult.Success.ShouldBeTrue(); - } - - [Fact] - public void should_not_have_inconclusive_package_result() - { - packageResult.Inconclusive.ShouldBeFalse(); - } - - [Fact] - public void should_not_have_warning_package_result() - { - packageResult.Warning.ShouldBeFalse(); - } - - [Fact] - public void config_should_match_package_result_name() - { - packageResult.Name.ShouldEqual(Configuration.PackageNames); - } - - [Fact] - public void should_have_a_version_of_one_dot_one_dot_zero() - { - packageResult.Version.ShouldEqual("1.1.0"); - } - } - - [Categories.SideBySide] - public class when_switching_a_side_by_side_package_to_a_normal_package : ScenariosBase - { - private PackageResult packageResult; - - public override void Context() - { - base.Context(); - Configuration.AllowMultipleVersions = true; - Scenario.install_package(Configuration, "installpackage", "1.0.0"); - Configuration.AllowMultipleVersions = false; - Configuration.Force = true; - } - - public override void Because() - { - Results = Service.install_run(Configuration); - packageResult = Results.FirstOrDefault().Value; - } - - [Fact] - public void should_install_where_install_location_reports() - { - DirectoryAssert.Exists(packageResult.InstallLocation); - } - - [Fact] - public void should_install_a_package_in_the_lib_directory() - { - var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); - - DirectoryAssert.Exists(packageDir); - } - - [Fact] - public void should_remove_version_directory_in_the_lib_directory() - { - var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames + ".1.0.0"); - - DirectoryAssert.DoesNotExist(packageDir); - } - - [Fact] - public void should_not_put_version_in_nupkg_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - Configuration.PackageNames, - (Configuration.PackageNames + NuGetConstants.PackageExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact] - public void should_not_put_version_in_nuspec_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - Configuration.PackageNames, - (Configuration.PackageNames + NuGetConstants.ManifestExtension)); - - FileAssert.Exists(packageFile); - } - - [Fact] - public void should_not_have_nupkg_with_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - Configuration.PackageNames, - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.PackageExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact] - public void should_not_have_nuspec_with_version_in_filename() - { - var packageFile = Path.Combine( - Scenario.get_top_level(), "lib", - Configuration.PackageNames, - (Configuration.PackageNames + ".1.0.0" + NuGetConstants.ManifestExtension)); - - FileAssert.DoesNotExist(packageFile); - } - - [Fact] - public void should_contain_a_warning_message_that_it_installed_successfully() - { - bool installedSuccessfully = false; - foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) - { - if (message.Contains("1/1")) installedSuccessfully = true; - } - - installedSuccessfully.ShouldBeTrue(); - } - - [Fact] - public void should_have_a_successful_package_result() - { - packageResult.Success.ShouldBeTrue(); - } - - [Fact] - public void should_not_have_inconclusive_package_result() - { - packageResult.Inconclusive.ShouldBeFalse(); - } - - [Fact] - public void should_not_have_warning_package_result() - { - packageResult.Warning.ShouldBeFalse(); - } - - [Fact] - public void config_should_match_package_result_name() - { - packageResult.Name.ShouldEqual(Configuration.PackageNames); - } - - [Fact] - public void should_have_a_version_of_one_dot_zero_dot_zero() - { - packageResult.Version.ShouldEqual("1.0.0"); - } - } - public class when_installing_a_package_with_dependencies_happy : ScenariosBase { public override void Context() diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index 3ed7a8ae5..8395658e9 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -3083,10 +3083,10 @@ public override void Context() Scenario.add_packages_to_source_location(Configuration, "hasdependency.*" + NuGetConstants.PackageExtension); Scenario.add_packages_to_source_location(Configuration, "isdependency.1*" + NuGetConstants.PackageExtension); Scenario.add_packages_to_source_location(Configuration, "isexactversiondependency*" + NuGetConstants.PackageExtension); - Configuration.AllowMultipleVersions = true; + Scenario.install_package(Configuration, "isdependency", "1.0.0"); Scenario.install_package(Configuration, "hasdependency", "1.0.0"); - Configuration.AllowMultipleVersions = false; + string dotChocolatey = Path.Combine(Scenario.get_top_level(), ".chocolatey"); if (Directory.Exists(dotChocolatey)) @@ -3833,10 +3833,16 @@ public override void Context() Scenario.add_packages_to_source_location(Configuration, "hasdependency.*" + NuGetConstants.PackageExtension); Scenario.add_packages_to_source_location(Configuration, "isdependency.*" + NuGetConstants.PackageExtension); Scenario.add_packages_to_source_location(Configuration, "isexactversiondependency*" + NuGetConstants.PackageExtension); - Configuration.AllowMultipleVersions = true; + Scenario.install_package(Configuration, "isdependency", "1.0.0"); Scenario.install_package(Configuration, "hasdependency", "1.0.0"); - Configuration.AllowMultipleVersions = false; + + foreach (var path in Scenario.get_installed_package_paths()) + { + // Mimic old side-by-side / legacy folder path locations by appending the versions + // to the package paths. + Scenario.move_directory(path, path + ".1.0.0"); + } string dotChocolatey = Path.Combine(Scenario.get_top_level(), ".chocolatey"); if (Directory.Exists(dotChocolatey)) diff --git a/src/chocolatey.tests/TinySpec.cs b/src/chocolatey.tests/TinySpec.cs index 0f05f941b..546eb7226 100644 --- a/src/chocolatey.tests/TinySpec.cs +++ b/src/chocolatey.tests/TinySpec.cs @@ -208,15 +208,6 @@ public ExceptionHandlingAttribute() } } - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] - public sealed class SideBySideAttribute : CategoryAttribute - { - public SideBySideAttribute() - : base("Side-by-Side") - { - } - } - /// /// Attribute used to define a test class or method as belonging to source priorities. /// diff --git a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs index 9eb359f23..f010beb6c 100644 --- a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs +++ b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyInstallCommandSpecs.cs @@ -165,18 +165,6 @@ public void should_add_applyInstallArgumentsToDependencies_to_the_option_set() optionSet.Contains("apply-install-arguments-to-dependencies").ShouldBeTrue(); } - [Fact] - public void should_add_allowmultipleversions_to_the_option_set() - { - optionSet.Contains("allowmultipleversions").ShouldBeTrue(); - } - - [Fact] - public void should_add_short_version_of_allowmultipleversions_to_the_option_set() - { - optionSet.Contains("m").ShouldBeTrue(); - } - [Fact] public void should_add_ignoredependencies_to_the_option_set() { diff --git a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs index 5fe367a9e..c95a9328d 100644 --- a/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs +++ b/src/chocolatey.tests/infrastructure.app/commands/ChocolateyUpgradeCommandSpecs.cs @@ -159,18 +159,6 @@ public void should_add_applyInstallArgumentsToDependencies_to_the_option_set() optionSet.Contains("apply-install-arguments-to-dependencies").ShouldBeTrue(); } - [Fact] - public void should_add_allowmultipleversions_to_the_option_set() - { - optionSet.Contains("allowmultipleversions").ShouldBeTrue(); - } - - [Fact] - public void should_add_short_version_of_allowmultipleversions_to_the_option_set() - { - optionSet.Contains("m").ShouldBeTrue(); - } - [Fact] public void should_add_ignoredependencies_to_the_option_set() { diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs index 993d0fb04..941e96925 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs @@ -255,10 +255,6 @@ prompt. In most cases you can still pass options and switches with one Starting in v2.0.0 the shortcut `cinst` will be removed and can not be used to install packages anymore. We recommend you make sure that you always use the full command going forward (`choco install`). - -Side by side installations has been deprecated and will be removed in v2.0.0. -Instead of using side by side installations, distinct packages should be created -if similar functionality is needed going forward. "); "chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage"); @@ -305,21 +301,6 @@ choco install nodejs.install --version 0.10.35 choco install choco install -Install multiple versions of a package using -m (AllowMultiple versions) - - choco install ruby --version 1.9.3.55100 -my - choco install ruby --version 2.0.0.59800 -my - choco install ruby --version 2.1.5 -my - -What is `-my`? See option bundling in the command reference - (`choco -?`). - -NOTE: All of these will add to PATH variable. We'll be adding a special - option to not allow PATH changes. Until then you will need to manually - go modify Path to just one Ruby and then use something like uru - (https://bitbucket.org/jonforums/uru) or pik - (https://community.chocolatey.org/packages/pik) to switch between versions. - NOTE: See scripting in the command reference (`choco -?`) for how to write proper scripts and integrations. @@ -378,8 +359,8 @@ Chocolatey Professional showing private download cache and virus scan diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs index e5021551d..8e3f12135 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs @@ -209,10 +209,6 @@ to determine how to automatically uninstall software. Starting in v2.0.0 the shortcut `cuninst` will be removed and can not be used to uninstall packages anymore. We recommend you make sure that you always use the full command going forward (`choco uninstall`). - -Side by side installations has been deprecated and support for uninstalling such packages will be removed in v2.0.0. -Instead of using side by side installations, distinct packages should be created -if similar functionality is needed going forward. "); "chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage"); diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index 592f6cacc..9bb83d473 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -72,9 +72,6 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon .Add("allowdowngrade|allow-downgrade", "AllowDowngrade - Should an attempt at downgrading be allowed? Defaults to false.", option => configuration.AllowDowngrade = option != null) - .Add("m|sxs|sidebyside|side-by-side|allowmultiple|allow-multiple|allowmultipleversions|allow-multiple-versions", - "AllowMultipleVersions - Should multiple versions of a package be installed? Defaults to false. (DEPRECATED)", - option => configuration.AllowMultipleVersions = option != null) .Add("i|ignoredependencies|ignore-dependencies", "IgnoreDependencies - Ignore dependencies when upgrading package(s). Defaults to false.", option => configuration.IgnoreDependencies = option != null) @@ -289,10 +286,6 @@ prompt. In most cases you can still pass options and switches with one Starting in v2.0.0 the shortcut `cup` will be removed and can not be used to upgrade or install packages anymore. We recommend you make sure that you always use the full command going forward (`choco upgrade`). - -Side by side installations has been deprecated and will be removed in v2.0.0. -Instead of using side by side installations, distinct packages should be created -if similar functionality is needed going forward. "); "chocolatey".Log().Info(ChocolateyLoggers.Important, "Usage"); diff --git a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs index ee4d5b0d0..5c4e8d5c1 100644 --- a/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs +++ b/src/chocolatey/infrastructure.app/configuration/PackagesConfigFilePackageSetting.cs @@ -50,9 +50,6 @@ public sealed class PackagesConfigFilePackageSetting [XmlAttribute(AttributeName = "forceX86")] public bool ForceX86 { get; set; } - [XmlAttribute(AttributeName = "allowMultipleVersions")] - public bool AllowMultipleVersions { get; set; } - [XmlAttribute(AttributeName = "ignoreDependencies")] public bool IgnoreDependencies { get; set; } diff --git a/src/chocolatey/infrastructure.app/domain/ChocolateyPackageInformation.cs b/src/chocolatey/infrastructure.app/domain/ChocolateyPackageInformation.cs index 0b10bb66d..3fb1f5fe5 100644 --- a/src/chocolatey/infrastructure.app/domain/ChocolateyPackageInformation.cs +++ b/src/chocolatey/infrastructure.app/domain/ChocolateyPackageInformation.cs @@ -34,9 +34,6 @@ public ChocolateyPackageInformation(IPackageMetadata package) public string Arguments { get; set; } public NuGetVersion VersionOverride { get; set; } public bool HasSilentUninstall { get; set; } - - [Obsolete("Side by side installations are deprecated, with removal pending in v2.0.0")] - public bool IsSideBySide { get; set; } public bool IsPinned { get; set; } public string ExtraInformation { get; set; } } diff --git a/src/chocolatey/infrastructure.app/nuget/ChocolateyPackagePathResolver.cs b/src/chocolatey/infrastructure.app/nuget/ChocolateyPackagePathResolver.cs index 9068d18ab..29453860a 100644 --- a/src/chocolatey/infrastructure.app/nuget/ChocolateyPackagePathResolver.cs +++ b/src/chocolatey/infrastructure.app/nuget/ChocolateyPackagePathResolver.cs @@ -30,14 +30,17 @@ namespace chocolatey.infrastructure.app.nuget public sealed class ChocolateyPackagePathResolver : PackagePathResolver { public string RootDirectory { get; set; } - public new bool UseSideBySidePaths { get; set; } private IFileSystem _filesystem; + public ChocolateyPackagePathResolver(string rootDirectory, IFileSystem filesystem) + : this(rootDirectory, filesystem, useSideBySidePaths: false) + { + } + public ChocolateyPackagePathResolver(string rootDirectory, IFileSystem filesystem, bool useSideBySidePaths) : base(rootDirectory, useSideBySidePaths) { RootDirectory = rootDirectory; - UseSideBySidePaths = useSideBySidePaths; _filesystem = filesystem; } @@ -62,12 +65,6 @@ public string GetInstallPath(string id, NuGetVersion version) return GetInstallPath(new PackageIdentity(id, version)); } - [Obsolete("Side by Side installations are deprecated, and is pending removal in v2.0.0")] - public override string GetPackageDirectoryName(PackageIdentity packageIdentity) - { - return GetPackageDirectory(packageIdentity, UseSideBySidePaths); - } - public string GetPackageDirectory(PackageIdentity packageIdentity, bool useVersionInPath) { string directory = packageIdentity.Id; diff --git a/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs b/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs index 5ae1003d5..3d15fca15 100644 --- a/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs +++ b/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs @@ -71,9 +71,13 @@ private static IConsole Console get { return _console.Value; } } + [Obsolete("This overload is obsolete and will be removed in a future version.")] public static ChocolateyPackagePathResolver GetPathResolver(ChocolateyConfiguration configuration, IFileSystem nugetPackagesFileSystem) + => GetPathResolver(nugetPackagesFileSystem); + + public static ChocolateyPackagePathResolver GetPathResolver(IFileSystem nugetPackagesFileSystem) { - return new ChocolateyPackagePathResolver(ApplicationParameters.PackagesLocation, nugetPackagesFileSystem, useSideBySidePaths: false); + return new ChocolateyPackagePathResolver(ApplicationParameters.PackagesLocation, nugetPackagesFileSystem); } public static void ClearRepositoriesCache() diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs index dce18232e..d40bd93d0 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageInformationService.cs @@ -141,26 +141,12 @@ has errored attempting to read it. This file will be renamed to ); packageInformation.HasSilentUninstall = _fileSystem.file_exists(_fileSystem.combine_paths(pkgStorePath, SILENT_UNINSTALLER_FILE)); - packageInformation.IsSideBySide = _fileSystem.file_exists(_fileSystem.combine_paths(pkgStorePath, SIDE_BY_SIDE_FILE)); packageInformation.IsPinned = _fileSystem.file_exists(_fileSystem.combine_paths(pkgStorePath, PIN_FILE)); var argsFile = _fileSystem.combine_paths(pkgStorePath, ARGS_FILE); if (_fileSystem.file_exists(argsFile)) packageInformation.Arguments = _fileSystem.read_file(argsFile); var extraInfoFile = _fileSystem.combine_paths(pkgStorePath, EXTRA_FILE); if (_fileSystem.file_exists(extraInfoFile)) packageInformation.ExtraInformation = _fileSystem.read_file(extraInfoFile); - if (packageInformation.IsSideBySide && !_deprecationWarning.Contains(package.Id)) - { - var logger = _config.RegularOutput ? - logging.ChocolateyLoggers.Important : - logging.ChocolateyLoggers.LogFileOnly; - - this.Log().Warn(logger, @" -{0} has been installed as a side by side installation. -Side by side installations are deprecated and is pending removal in v2.0.0.", package.Id); - - _deprecationWarning.Add(package.Id); - } - var versionOverrideFile = _fileSystem.combine_paths(pkgStorePath, VERSION_OVERRIDE_FILE); if (_fileSystem.file_exists(versionOverrideFile)) { @@ -248,14 +234,9 @@ public void save_package_information(ChocolateyPackageInformation packageInforma { _fileSystem.write_file(_fileSystem.combine_paths(pkgStorePath, SILENT_UNINSTALLER_FILE), string.Empty, Encoding.ASCII); } - if (packageInformation.IsSideBySide) - { - _fileSystem.write_file(_fileSystem.combine_paths(pkgStorePath, SIDE_BY_SIDE_FILE), string.Empty, Encoding.ASCII); - } - else - { - _fileSystem.delete_file(_fileSystem.combine_paths(pkgStorePath, SIDE_BY_SIDE_FILE)); - } + + // Legacy side-by-side installation data cleanup + _fileSystem.delete_file(_fileSystem.combine_paths(pkgStorePath, SIDE_BY_SIDE_FILE)); if (packageInformation.IsPinned) { diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 0f6cacdd8..ad9811e28 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -513,10 +513,6 @@ private void create_ignore_files_for_executables(string installLocation, bool is protected virtual ChocolateyPackageInformation get_package_information(PackageResult packageResult, ChocolateyConfiguration config) { var pkgInfo = _packageInfoService.get_package_information(packageResult.PackageMetadata); - if (config.AllowMultipleVersions) - { - pkgInfo.IsSideBySide = true; - } return pkgInfo; } @@ -547,7 +543,6 @@ private string capture_arguments(ChocolateyConfiguration config, PackageResult p if (config.ApplyPackageParametersToDependencies) arguments.Append(" --apply-package-parameters-to-dependencies"); if (config.AllowDowngrade) arguments.Append(" --allow-downgrade"); - if (config.AllowMultipleVersions) arguments.Append(" --allow-multiple-versions"); // most times folks won't want to skip automation scripts on upgrade //if (config.SkipPackageInstallProvider) arguments.Append(" --skip-automation-scripts"); @@ -581,11 +576,6 @@ public virtual ConcurrentDictionary install_run(Chocolate { validate_package_names(config); - if (config.AllowMultipleVersions) - { - this.Log().Warn(ChocolateyLoggers.Important, "Installing the same package with multiple versions is deprecated and will be removed in v2.0.0."); - } - this.Log().Info(is_packages_config_file(config.PackageNames) ? @"Installing from config file:" : @"Installing the following packages:"); this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(config.PackageNames)); @@ -746,7 +736,6 @@ private IEnumerable get_packages_from_config(string pac packageConfig.InstallArguments = string.IsNullOrWhiteSpace(pkgSettings.InstallArguments) ? packageConfig.InstallArguments : pkgSettings.InstallArguments; packageConfig.PackageParameters = string.IsNullOrWhiteSpace(pkgSettings.PackageParameters) ? packageConfig.PackageParameters : pkgSettings.PackageParameters; if (pkgSettings.ForceX86) packageConfig.ForceX86 = true; - if (pkgSettings.AllowMultipleVersions) packageConfig.AllowMultipleVersions = true; if (pkgSettings.IgnoreDependencies) packageConfig.IgnoreDependencies = true; if (pkgSettings.ApplyInstallArgumentsToDependencies) packageConfig.ApplyInstallArgumentsToDependencies = true; if (pkgSettings.ApplyPackageParametersToDependencies) packageConfig.ApplyPackageParametersToDependencies = true; @@ -831,11 +820,6 @@ public virtual ConcurrentDictionary upgrade_run(Chocolate { validate_package_names(config); - if (config.AllowMultipleVersions) - { - this.Log().Warn(ChocolateyLoggers.Important, "Upgrading the same package with multiple versions is deprecated and will be removed in v2.0.0."); - } - this.Log().Info(@"Upgrading the following packages:"); this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(config.PackageNames)); diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 957b3cbe0..c9e7a714f 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -474,7 +474,7 @@ public virtual ConcurrentDictionary install_run(Chocolate var sourceCacheContext = new ChocolateySourceCacheContext(config); var remoteRepositories = NugetCommon.GetRemoteRepositories(config, _nugetLogger, _fileSystem); var localRepositorySource = NugetCommon.GetLocalRepository(); - var pathResolver = NugetCommon.GetPathResolver(config, _fileSystem); + var pathResolver = NugetCommon.GetPathResolver(_fileSystem); var nugetProject = new FolderNuGetProject(ApplicationParameters.PackagesLocation, pathResolver, NuGetFramework.AnyFramework); var projectContext = new ChocolateyNuGetProjectContext(config, _nugetLogger); @@ -534,7 +534,6 @@ public virtual ConcurrentDictionary install_run(Chocolate var sourcePackageDependencyInfos = new HashSet(PackageIdentityComparer.Default); var localPackageToRemoveDependencyInfos = new HashSet(PackageIdentityComparer.Default); - //todo: #2577 get smarter about realizing multiple versions have been installed before and allowing that var installedPackage = allLocalPackages.FirstOrDefault(p => p.Name.Equals(packageName)); if (Platform.get_platform() != PlatformType.Windows && !packageName.EndsWith(".template")) @@ -1030,9 +1029,8 @@ public virtual ConcurrentDictionary upgrade_run(Chocolate continue; } - //Needs to be set here to ensure that the path resolver has the side by side option set correctly. set_package_config_for_upgrade(config, pkgInfo); - var pathResolver = NugetCommon.GetPathResolver(config, _fileSystem); + var pathResolver = NugetCommon.GetPathResolver(_fileSystem); var nugetProject = new FolderNuGetProject(ApplicationParameters.PackagesLocation, pathResolver, NuGetFramework.AnyFramework); if (version != null && version < installedPackage.PackageMetadata.Version && !config.AllowDowngrade) @@ -1086,11 +1084,6 @@ public virtual ConcurrentDictionary upgrade_run(Chocolate continue; } - if (pkgInfo != null && pkgInfo.IsSideBySide) - { - //todo: #103 get smarter about realizing multiple versions have been installed before and allowing that - } - var packageResult = packageResultsToReturn.GetOrAdd(packageName, new PackageResult(availablePackage, pathResolver.GetInstallPath(availablePackage.Identity))); if (installedPackage.PackageMetadata.Version > availablePackage.Identity.Version && (!config.AllowDowngrade || (config.AllowDowngrade && version == null))) { @@ -1479,7 +1472,7 @@ public virtual ConcurrentDictionary get_outdated(Chocolat { var remoteRepositories = NugetCommon.GetRemoteRepositories(config, _nugetLogger, _fileSystem); - var pathResolver = NugetCommon.GetPathResolver(config, _fileSystem); + var pathResolver = NugetCommon.GetPathResolver(_fileSystem); var outdatedPackages = new ConcurrentDictionary(); @@ -1541,15 +1534,6 @@ public virtual ConcurrentDictionary get_outdated(Chocolat packageResult.Messages.Add(new ResultMessage(ResultType.Note, logMessage)); this.Log().Info("{0}|{1}|{2}|{3}".format_with(installedPackage.Name, installedPackage.Version, latestPackage.Identity.Version, isPinned.to_string().to_lower())); - - if (pkgInfo.IsSideBySide) - { - var deprecationMessage = @" -{0} v{1} has been installed as a side by side installation. -Side by side installations are deprecated and is pending removal in v2.0.0".format_with(installedPackage.Name, installedPackage.Version); - - packageResult.Messages.Add(new ResultMessage(ResultType.Warn, deprecationMessage)); - } } // Reset the configuration again once we are completely done with the processing of @@ -1777,19 +1761,12 @@ private void validate_nuspec(string nuspecFilePath, ChocolateyConfiguration conf private string get_install_directory(ChocolateyConfiguration config, IPackageMetadata installedPackage) { - - var pathResolver = NugetCommon.GetPathResolver(config, _fileSystem); + var pathResolver = NugetCommon.GetPathResolver(_fileSystem); var installDirectory = pathResolver.GetInstallPath(new PackageIdentity(installedPackage.Id, installedPackage.Version)); + if (!_fileSystem.directory_exists(installDirectory)) { - var chocoPathResolver = pathResolver as ChocolateyPackagePathResolver; - if (chocoPathResolver != null) - { - chocoPathResolver.UseSideBySidePaths = !chocoPathResolver.UseSideBySidePaths; - installDirectory = chocoPathResolver.GetInstallPath(new PackageIdentity(installedPackage.Id, installedPackage.Version)); - } - - if (!_fileSystem.directory_exists(installDirectory)) return null; + return null; } return installDirectory; @@ -2375,10 +2352,9 @@ protected void backup_existing_package_files(ChocolateyConfiguration config, IPa private void ensure_nupkg_is_removed(IPackageMetadata removedPackage, ChocolateyPackageInformation pkgInfo) { this.Log().Debug(ChocolateyLoggers.Verbose, "Removing nupkg if it still exists."); - var isSideBySide = pkgInfo != null && pkgInfo.IsSideBySide; - var nupkgFile = "{0}{1}.nupkg".format_with(removedPackage.Id, isSideBySide ? "." + removedPackage.Version.to_string() : string.Empty); - var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, "{0}{1}".format_with(removedPackage.Id, isSideBySide ? "." + removedPackage.Version.to_string() : string.Empty)); + var nupkgFile = "{0}.nupkg".format_with(removedPackage.Id); + var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, removedPackage.Id); var nupkg = _fileSystem.combine_paths(installDir, nupkgFile); if (!_fileSystem.file_exists(nupkg)) return; @@ -2411,8 +2387,7 @@ private void fix_nuspec_casing(IPackageSearchMetadata packageMetadata, string pa public virtual void remove_installation_files_unsafe(IPackageMetadata removedPackage, ChocolateyPackageInformation pkgInfo) { this.Log().Debug(ChocolateyLoggers.Verbose, "Ensuring removal of installation files."); - var isSideBySide = pkgInfo != null && pkgInfo.IsSideBySide; - var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, "{0}{1}".format_with(removedPackage.Id, isSideBySide ? "." + removedPackage.Version.to_string() : string.Empty)); + var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, removedPackage.Id); if (_fileSystem.directory_exists(installDir) && pkgInfo != null && pkgInfo.FilesSnapshot != null) { @@ -2446,8 +2421,7 @@ public virtual void remove_installation_files_unsafe(IPackageMetadata removedPac public virtual void remove_installation_files(IPackageMetadata removedPackage, ChocolateyPackageInformation pkgInfo) { this.Log().Debug(ChocolateyLoggers.Verbose, "Ensuring removal of installation files."); - var isSideBySide = pkgInfo != null && pkgInfo.IsSideBySide; - var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, "{0}{1}".format_with(removedPackage.Id, isSideBySide ? "." + removedPackage.Version.to_string() : string.Empty)); + var installDir = _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, removedPackage.Id); if (_fileSystem.directory_exists(installDir) && pkgInfo != null && pkgInfo.FilesSnapshot != null) { diff --git a/tests/chocolatey-tests/commands/choco-info.Tests.ps1 b/tests/chocolatey-tests/commands/choco-info.Tests.ps1 index e45838a22..7fc0a27af 100644 --- a/tests/chocolatey-tests/commands/choco-info.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-info.Tests.ps1 @@ -145,24 +145,6 @@ Describe "choco info" -Tag Chocolatey, InfoCommand { } } - Context "Listing package information about local side by side installed package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - $null = Invoke-Choco install 'isdependency' --confirm --sxs - - $Output = Invoke-Choco info 'isdependency' --local-only - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Outputs a warning message that installed side by side package is deprecated" { - $Output.Lines | Should -Contain "isdependency has been installed as a side by side installation." -Because $Output.String - $Output.Lines | Should -Contain "Side by side installations are deprecated and is pending removal in v2.0.0." -Because $Output.String - } - } - # This needs to be the last test in this block, to ensure NuGet configurations aren't being created. Test-NuGetPaths } diff --git a/tests/chocolatey-tests/commands/choco-install.Tests.ps1 b/tests/chocolatey-tests/commands/choco-install.Tests.ps1 index 15a42f3a5..002f85feb 100644 --- a/tests/chocolatey-tests/commands/choco-install.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-install.Tests.ps1 @@ -159,7 +159,7 @@ Describe "choco install" -Tag Chocolatey, InstallCommand { diff --git a/tests/chocolatey-tests/commands/choco-uninstall.Tests.ps1 b/tests/chocolatey-tests/commands/choco-uninstall.Tests.ps1 index ed9aae184..c2935bc25 100644 --- a/tests/chocolatey-tests/commands/choco-uninstall.Tests.ps1 +++ b/tests/chocolatey-tests/commands/choco-uninstall.Tests.ps1 @@ -12,36 +12,6 @@ Describe "choco uninstall" -Tag Chocolatey, UninstallCommand { Remove-ChocolateyTestInstall } - Context "Uninstalling a side-by-side Package" { - BeforeAll { - Restore-ChocolateyInstallSnapshot - - $PackageUnderTest = "installpackage" - - $null = Invoke-Choco upgrade $PackageUnderTest --confirm --allowmultipleversions - - $Output = Invoke-Choco uninstall $PackageUnderTest --confirm - } - - It "Exits with Success (0)" { - $Output.ExitCode | Should -Be 0 - } - - It "Removed a package to the lib directory" { - "$env:ChocolateyInstall\lib\$($PackageUnderTest).1.0.0" | Should -Not -Exist - "$env:ChocolateyInstall\lib-bad\$($PackageUnderTest).1.0.0" | Should -Not -Exist - } - - It "Outputs a warning message that installed side by side package is deprecated" { - $Output.Lines | Should -Contain "$PackageUnderTest has been installed as a side by side installation." -Because $Output.String - $Output.Lines | Should -Contain "Side by side installations are deprecated and is pending removal in v2.0.0." -Because $Output.String - } - - It "Outputs a message indicating that it uninstalled the package successfully" { - $Output.Lines | Should -Contain "Chocolatey uninstalled 1/1 packages." -Because $Output.String - } - } - Context "Uninstalling package that makes use of new Get Chocolatey Path helper" { BeforeAll { Restore-ChocolateyInstallSnapshot