diff --git a/src/chocolatey.tests.integration/context/uppercase/1.0.0/UpperCase.nuspec b/src/chocolatey.tests.integration/context/uppercase/1.0.0/UpperCase.nuspec new file mode 100644 index 0000000000..7e27d66f1a --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.0.0/UpperCase.nuspec @@ -0,0 +1,18 @@ + + + + UpperCase + 1.0.0 + UpperCase + __REPLACE_AUTHORS_OF_SOFTWARE__ + __REPLACE_YOUR_NAME__ + false + __REPLACE__ + __REPLACE__ + + UpperCase admin + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyBeforeModify.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyBeforeModify.ps1 new file mode 100644 index 0000000000..af5bb142e8 --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyBeforeModify.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Before Modification" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyinstall.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyuninstall.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.0.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.1.0/UpperCase.nuspec b/src/chocolatey.tests.integration/context/uppercase/1.1.0/UpperCase.nuspec new file mode 100644 index 0000000000..c5ec5c2a80 --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.1.0/UpperCase.nuspec @@ -0,0 +1,18 @@ + + + + UpperCase + 1.1.0 + UpperCase + __REPLACE_AUTHORS_OF_SOFTWARE__ + __REPLACE_YOUR_NAME__ + false + __REPLACE__ + __REPLACE__ + + UpperCase admin + + + + + \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyBeforeModify.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyBeforeModify.ps1 new file mode 100644 index 0000000000..af5bb142e8 --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyBeforeModify.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Before Modification" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyinstall.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000000..d64eb8f47b --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyinstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Installed" \ No newline at end of file diff --git a/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyuninstall.ps1 b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000000..9ead91ffa3 --- /dev/null +++ b/src/chocolatey.tests.integration/context/uppercase/1.1.0/tools/chocolateyuninstall.ps1 @@ -0,0 +1 @@ +Write-Output "$env:PackageName $env:PackageVersion Uninstalled" \ 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 918c0ccc80..074b8620a4 100644 --- a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -4818,5 +4818,120 @@ public void should_have_success_package_results() } } } + + public class when_installing_a_package_with_an_uppercase_id : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Scenario.add_packages_to_source_location(Configuration, "UpperCase.1.0.0" + NuGetConstants.PackageExtension); + Configuration.PackageNames = Configuration.Input = "UpperCase"; + } + + 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_the_package_in_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + DirectoryAssert.Exists(packageDir); + } + + [Fact] + public void should_have_the_correct_casing_for_the_nuspec() + { + var nuspecFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + NuGetConstants.ManifestExtension); + FileAssert.Exists(nuspecFile); + } + + [Fact] + public void should_install_the_expected_version_of_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + NuGetConstants.PackageExtension); + using (var packageReader = new PackageArchiveReader(packageFile)) + { + packageReader.NuspecReader.GetVersion().to_string().ShouldEqual("1.0.0"); + } + } + + [Fact] + public void should_not_create_an_extensions_folder_for_the_package() + { + var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(extensionsDirectory); + } + + [Fact] + public void should_not_create_an_hooks_folder_for_the_package() + { + var hooksDirectory = Path.Combine(Scenario.get_top_level(), "hooks", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(hooksDirectory); + } + + [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"); + } + + [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyInstall_script() + { + MockLogger.contains_message("UpperCase 1.0.0 Installed", LogLevel.Info).ShouldBeTrue(); + } + } } } diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index 55c6a47b8e..5c08986d80 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -759,5 +759,57 @@ public void should_find_all_versions_in_descending_order() Results[2].PackageMetadata.Version.ToNormalizedString().ShouldEqual("0.9.0"); } } + + public class when_listing_local_packages_with_uppercase_id_package_installed : ScenariosBase + { + public override void Context() + { + base.Context(); + Scenario.add_packages_to_source_location(Configuration, "UpperCase" + "*" + NuGetConstants.PackageExtension); + Scenario.install_package(Configuration, "UpperCase", "1.1.0"); + + Configuration.ListCommand.LocalOnly = true; + Configuration.Sources = ApplicationParameters.PackagesLocation; + } + + public override void Because() + { + MockLogger.reset(); + Results = Service.list_run(Configuration).ToList(); + } + + [Fact] + public void should_contain_packages_and_versions_with_a_space_between_them() + { + MockLogger.contains_message("upgradepackage 1.0.0").ShouldBeTrue(); + } + + [Fact] + public void should_contain_uppercase_id_package() + { + MockLogger.contains_message("UpperCase 1.1.0").ShouldBeTrue(); + } + + [Fact] + public void should_not_contain_packages_and_versions_with_a_pipe_between_them() + { + MockLogger.contains_message("upgradepackage|1.0.0").ShouldBeFalse(); + } + + [Fact] + public void should_contain_a_summary() + { + MockLogger.contains_message("packages installed").ShouldBeTrue(); + } + + [Fact] + public void should_contain_debugging_messages() + { + MockLogger.contains_message("Searching for package information", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("Running list with the following filter", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("Start of List", LogLevel.Debug).ShouldBeTrue(); + MockLogger.contains_message("End of List", LogLevel.Debug).ShouldBeTrue(); + } + } } } diff --git a/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs index c624bfd56a..cdc5180356 100644 --- a/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UninstallScenarios.cs @@ -1322,5 +1322,92 @@ public void should_have_executed_post_beforemodify_hook_script() } } + public class when_uninstalling_a_package_with_uppercase_id : ScenariosBase + { + private PackageResult packageResult; + + public override void Context() + { + base.Context(); + Scenario.add_packages_to_source_location(Configuration, "UpperCase" + "*" + NuGetConstants.PackageExtension); + Scenario.install_package(Configuration, "UpperCase", "1.1.0"); + + Configuration.PackageNames = Configuration.Input = "UpperCase"; + } + + public override void Because() + { + Results = Service.uninstall_run(Configuration); + packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_remove_the_package_from_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(packageDir); + } + + [Fact] + public void should_delete_the_rollback() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib-bkp", Configuration.PackageNames); + + DirectoryAssert.DoesNotExist(packageDir); + } + + [Fact] + public void should_contain_a_warning_message_that_it_uninstalled_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] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyBeforeModify_script() + { + MockLogger.contains_message("UpperCase 1.1.0 Before Modification", LogLevel.Info).ShouldBeTrue(); + } + + [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyUninstall_script() + { + MockLogger.contains_message("UpperCase 1.1.0 Uninstalled", LogLevel.Info).ShouldBeTrue(); + } + } } } diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index 05ab0a741f..4353f37ba7 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -4364,5 +4364,148 @@ public void should_not_have_executed_beforemodify_hook_script_for_upgrade_versio MockLogger.contains_message("pre-beforemodify-all.ps1 hook ran for upgradepackage 1.1.0", LogLevel.Info).ShouldBeFalse(); } } + public class when_upgrading_an_existing_package_with_uppercase_id : ScenariosBase + { + private PackageResult _packageResult; + + public override void Context() + { + base.Context(); + Scenario.add_packages_to_source_location(Configuration, "UpperCase" + "*" + NuGetConstants.PackageExtension); + Scenario.install_package(Configuration, "UpperCase", "1.0.0"); + + Configuration.PackageNames = Configuration.Input = "UpperCase"; + } + + public override void Because() + { + Results = Service.upgrade_run(Configuration); + _packageResult = Results.FirstOrDefault().Value; + } + + [Fact] + public void should_have_the_correct_casing_for_the_nuspec() + { + var nuspecFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + NuGetConstants.ManifestExtension); + FileAssert.Exists(nuspecFile); + } + + [Fact] + public void should_upgrade_where_install_location_reports() + { + DirectoryAssert.Exists(_packageResult.InstallLocation); + } + + [Fact] + public void should_upgrade_a_package_in_the_lib_directory() + { + var packageDir = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames); + + DirectoryAssert.Exists(packageDir); + } + + [Fact] + public void should_upgrade_the_package() + { + var packageFile = Path.Combine(Scenario.get_top_level(), "lib", Configuration.PackageNames, Configuration.PackageNames + NuGetConstants.PackageExtension); + using (var packageReader = new PackageArchiveReader(packageFile)) + { + packageReader.NuspecReader.GetVersion().to_string().ShouldEqual("1.1.0"); + } + } + + [Fact] + public void should_contain_a_warning_message_that_it_upgraded_successfully() + { + bool upgradedSuccessMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("upgraded 1/1")) upgradedSuccessMessage = true; + } + + upgradedSuccessMessage.ShouldBeTrue(); + } + + [Fact] + public void should_contain_a_warning_message_with_old_and_new_versions() + { + bool upgradeMessage = false; + foreach (var message in MockLogger.MessagesFor(LogLevel.Warn).or_empty_list_if_null()) + { + if (message.Contains("You have UpperCase v1.0.0 installed. Version 1.1.0 is available based on your source")) upgradeMessage = true; + } + + upgradeMessage.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_match_the_upgrade_version_of_one_dot_one_dot_zero() + { + _packageResult.Version.ShouldEqual("1.1.0"); + } + + [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyBeforeModify_script_for_original_package() + { + MockLogger.contains_message("UpperCase 1.0.0 Before Modification", LogLevel.Info).ShouldBeTrue(); + } + + [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyBeforeModify_before_chocolateyInstall() + { + MockLogger.MessagesFor(LogLevel.Info).or_empty_list_if_null() + .SkipWhile(p => !p.Contains("UpperCase 1.0.0 Before Modification")) + .Any(p => p.EndsWith("UpperCase 1.1.0 Installed")) + .ShouldBeTrue(); + } + + [Fact] + public void should_not_have_executed_chocolateyUninstall_script_for_original_package() + { + MockLogger.contains_message("UpperCase 1.0.0 Uninstalled", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + public void should_not_have_executed_chocolateyBeforeModify_script_for_new_package() + { + MockLogger.contains_message("UpperCase 1.1.0 Before Modification", LogLevel.Info).ShouldBeFalse(); + } + + [Fact] + [WindowsOnly] + [Platform(Exclude = "Mono")] + public void should_have_executed_chocolateyInstall_script_for_new_package() + { + MockLogger.contains_message("UpperCase 1.1.0 Installed", LogLevel.Info).ShouldBeTrue(); + } + } } } diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 6ad36089b4..a42ee94910 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -771,13 +771,15 @@ Version was specified as '{0}'. It is possible that version } + var installedPath = nugetProject.GetInstalledPath(packageDependencyInfo); + + fix_nuspec_casing(availablePackage, installedPath); + remove_nuget_cache_for_package(availablePackage); var manifestPath = nugetProject.GetInstalledManifestFilePath(packageDependencyInfo); var packageMetadata = new ChocolateyPackageMetadata(manifestPath, _fileSystem); - var installedPath = nugetProject.GetInstalledPath(packageDependencyInfo); - this.Log().Info(ChocolateyLoggers.Important, "{0}{1} v{2}{3}{4}{5}".format_with( System.Environment.NewLine, packageMetadata.Id, @@ -1307,11 +1309,13 @@ public virtual ConcurrentDictionary upgrade_run(Chocolate } + var installedPath = nugetProject.GetInstalledPath(packageDependencyInfo); + + fix_nuspec_casing(availablePackage, installedPath); + var manifestPath = nugetProject.GetInstalledManifestFilePath(packageDependencyInfo); var packageMetadata = new ChocolateyPackageMetadata(manifestPath, _fileSystem); - var installedPath = nugetProject.GetInstalledPath(packageDependencyInfo); - remove_nuget_cache_for_package(availablePackage); this.Log().Info(ChocolateyLoggers.Important, "{0}{1} v{2}{3}{4}{5}".format_with( @@ -1939,7 +1943,7 @@ public virtual ConcurrentDictionary uninstall_run(Chocola remove_rollback_directory_if_exists(packageName); backup_existing_version(config, packageToUninstall.PackageMetadata, uninstallPkgInfo); - var packageResult = packageResultsToReturn.GetOrAdd(packageToUninstall.Name.to_lower() + "." + packageToUninstall.Version.to_string(), packageToUninstall); + var packageResult = packageResultsToReturn.GetOrAdd(packageToUninstall.Name + "." + packageToUninstall.Version.to_string(), packageToUninstall); packageResult.InstallLocation = packageToUninstall.InstallLocation; string logMessage = "{0}{1} v{2}{3}".format_with(Environment.NewLine, packageToUninstall.Name, packageToUninstall.Version.to_string(), config.Force ? " (forced)" : string.Empty); packageResult.Messages.Add(new ResultMessage(ResultType.Debug, ApplicationParameters.Messages.ContinueChocolateyAction)); @@ -1974,12 +1978,12 @@ public virtual ConcurrentDictionary uninstall_run(Chocola { var logMessage = "{0} not uninstalled. An error occurred during uninstall:{1} {2}".format_with(packageName, Environment.NewLine, ex.Message); this.Log().Error(ChocolateyLoggers.Important, logMessage); - var result = packageResultsToReturn.GetOrAdd(packageToUninstall.Name.to_lower() + "." + packageToUninstall.Version.to_string(), new PackageResult(packageToUninstall.PackageMetadata, pathResolver.GetInstallPath(packageToUninstall.PackageMetadata.Id, packageToUninstall.PackageMetadata.Version))); + var result = packageResultsToReturn.GetOrAdd(packageToUninstall.Name + "." + packageToUninstall.Version.to_string(), new PackageResult(packageToUninstall.PackageMetadata, pathResolver.GetInstallPath(packageToUninstall.PackageMetadata.Id, packageToUninstall.PackageMetadata.Version))); result.Messages.Add(new ResultMessage(ResultType.Error, logMessage)); if (result.ExitCode == 0) result.ExitCode = 1; if (config.Features.StopOnFirstPackageFailure) { - throw new ApplicationException("Stopping further execution as {0} has failed uninstallation".format_with(packageToUninstall.Name.to_lower())); + throw new ApplicationException("Stopping further execution as {0} has failed uninstallation".format_with(packageToUninstall.Name)); } // do not call continueAction - will result in multiple passes } @@ -1988,7 +1992,7 @@ public virtual ConcurrentDictionary uninstall_run(Chocola else { // continue action won't be found b/c we are not actually uninstalling (this is noop) - var result = packageResultsToReturn.GetOrAdd(installedPackage.Name.to_lower() + "." + installedPackage.Version.to_string(), new PackageResult(installedPackage.PackageMetadata, pathResolver.GetInstallPath(installedPackage.PackageMetadata.Id, installedPackage.PackageMetadata.Version))); + var result = packageResultsToReturn.GetOrAdd(installedPackage.Name + "." + installedPackage.Version.to_string(), new PackageResult(installedPackage.PackageMetadata, pathResolver.GetInstallPath(installedPackage.PackageMetadata.Id, installedPackage.PackageMetadata.Version))); if (continueAction != null) continueAction.Invoke(result, config); } } @@ -2025,6 +2029,25 @@ private void ensure_nupkg_is_removed(IPackageMetadata removedPackage, Chocolatey throwError: true); } + private void fix_nuspec_casing(IPackageSearchMetadata packageMetadata, string packageLocation) + { + if (Platform.get_platform() == PlatformType.Windows) return; + this.Log().Debug(ChocolateyLoggers.Verbose, "Fixing nuspec casing if required"); + + var expectedNuspec = _fileSystem.combine_paths(packageLocation, "{0}{1}" + .format_with(packageMetadata.Identity.Id, NuGetConstants.ManifestExtension)); + var lowercaseNuspec = _fileSystem.combine_paths(packageLocation, "{0}{1}" + .format_with(packageMetadata.Identity.Id.to_lower(), NuGetConstants.ManifestExtension)); + + if (!_fileSystem.file_exists(expectedNuspec) && _fileSystem.file_exists(lowercaseNuspec)) + { + FaultTolerance.try_catch_with_logging_exception( + () => _fileSystem.move_file(lowercaseNuspec, expectedNuspec), + "Error moving nuspec file {0} to {1}".format_with(lowercaseNuspec, expectedNuspec), + throwError: true); + } + } + public virtual void remove_installation_files_unsafe(IPackageMetadata removedPackage, ChocolateyPackageInformation pkgInfo) { this.Log().Debug(ChocolateyLoggers.Verbose, "Ensuring removal of installation files."); diff --git a/src/chocolatey/infrastructure/results/PackageResult.cs b/src/chocolatey/infrastructure/results/PackageResult.cs index a20fd5b56b..572b90c926 100644 --- a/src/chocolatey/infrastructure/results/PackageResult.cs +++ b/src/chocolatey/infrastructure/results/PackageResult.cs @@ -54,17 +54,17 @@ public void ResetMetadata(IPackageMetadata metadata, IPackageSearchMetadata sear { PackageMetadata = metadata; SearchMetadata = search; - Name = metadata.Id.to_lower(); + Name = metadata.Id; Version = metadata.Version.to_string(); } - public PackageResult(IPackageMetadata packageMetadata, string installLocation, string source = null) : this(packageMetadata.Id.to_lower(), packageMetadata.Version.to_string(), installLocation) + public PackageResult(IPackageMetadata packageMetadata, string installLocation, string source = null) : this(packageMetadata.Id, packageMetadata.Version.to_string(), installLocation) { PackageMetadata = packageMetadata; Source = source; } - public PackageResult(IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageSearch.Identity.Id.to_lower(), packageSearch.Identity.Version.to_string(), installLocation) + public PackageResult(IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageSearch.Identity.Id, packageSearch.Identity.Version.to_string(), installLocation) { SearchMetadata = packageSearch; Source = source; @@ -103,7 +103,7 @@ public PackageResult(IPackageSearchMetadata packageSearch, string installLocatio */ } - public PackageResult(IPackageMetadata packageMetadata, IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageMetadata.Id.to_lower(), packageMetadata.Version.to_string(), installLocation) + public PackageResult(IPackageMetadata packageMetadata, IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageMetadata.Id, packageMetadata.Version.to_string(), installLocation) { SearchMetadata = packageSearch; PackageMetadata = packageMetadata;