From 51f45a48e9c11dfaa941d5902820b4d66989616d Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 20 Jun 2015 08:01:24 -0500 Subject: [PATCH 1/4] (doc) update changelog/nuspec --- CHANGELOG.md | 39 ++++++++++++++++++++++++++++++ nuget/chocolatey/chocolatey.nuspec | 39 ++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a86179b86f..ff79307c0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,42 @@ +## [0.9.9.7](https://github.com/chocolatey/choco/issues?q=milestone%3A0.9.9.7+is%3Aclosed) (unreleased) + +"Fix Everything. Fix All The Things" - There have been some things bugging us for a long time related to limitations with NuGet, so we decided to fix that. Like [nuspec enhancements](https://github.com/chocolatey/choco/issues/205), that crazy [content folder restriction](https://github.com/chocolatey/choco/issues/290) has been removed (I know, right?!), and we're working around [badly](https://github.com/chocolatey/choco/issues/316) [behaved](https://github.com/chocolatey/choco/issues/326) packages quite a bit more to bring you more feature parity. + +Let's talk about a couple of big, like really big, BIG features just added with this release. No more packages rebooting Windows. We fixed ([#304](https://github.com/chocolatey/choco/issues/304) / [#323](https://github.com/chocolatey/choco/issues/323)) and [enhanced](https://github.com/chocolatey/choco/issues/305) up the Auto Uninstaller Service quite a bit to ensure things are working like you would expect (It goes on by default in 0.9.10 - we'll start documenting more about it soon). But wait, there's more! I haven't even told you about the big features yet + +The first big feature is enhancing the nuspec. I mentioned this I know, but *now* you can use `packageSourceUrl` in the nuspec to tell folks where you are storing the source for the package! We also added `projectSourceUrl`, `docsUrl`, `mailingListUrl`, and `bugTrackerUrl`. What's even better is that the community feed has already been enhanced to look for these values. So have the templates from `choco new`. And it's backwards compatible, meaning you can still install packages that have these added nuspec enhancements without issue (but we will need to provide a fix for Nuget Package Explorer). + +The second is Xml Document Transformations (XDT), which I think many folks are aware of but may not realize what it can provide. [NuGet has allowed transformations for quite awhile](https://docs.nuget.org/Create/Configuration-File-and-Source-Code-Transformations) to allow you to make changes to an `app.config`/`web.config` on install/uninstall. We are following in similar footsteps to allow you to do similar when installing/upgrading packages. We will look for `*.install.xdt` files in the package (doesn't matter where) and they will apply to configuration files with the same name in the package. This means that during upgrades we won't overwrite configuration files during upgrades that have opted into this feature. It allows you to give users a better experience during upgrades because they won't need to keep making the same changes to the xml config files each time they upgrade your package. + +### FEATURES + + * Allow XDT Configuration Transforms - see [#331](https://github.com/chocolatey/choco/issues/331) + * Prevent reboots - see [#316](https://github.com/chocolatey/choco/issues/316) + * Enhance the nuspec - first wave - see [#205](https://github.com/chocolatey/choco/issues/205) + * Uninstaller Service Enhancements - see [#305](https://github.com/chocolatey/choco/issues/305) + +### BUG FIXES + + * When uninstall fails, do not continue removing files - see [#315](https://github.com/chocolatey/choco/issues/315) + * Do not run autouninstaller if the package result is already a failure - see [#323](https://github.com/chocolatey/choco/issues/323) + * Fix - Auto Uninstaller can fail if chocolateyUninstall.ps1 uninstalls prior to it running - see [#304](https://github.com/chocolatey/choco/issues/304) + * Fix - Packages with content folders cannot have a dependency without also having a content folder - see [#290](https://github.com/chocolatey/choco/issues/290) + * Remove ShimGen director files on upgrade/uninstall - see [#326](https://github.com/chocolatey/choco/issues/326) + * If feature doesn't exist, throw an error - see [#317](https://github.com/chocolatey/choco/issues/317) + * Fix - The operation completed successfully on stderr - see [#249](https://github.com/chocolatey/choco/issues/249) + * Fix - When specific nuget version is needed by a package it is the chocolatey version that is used - see [#194](https://github.com/chocolatey/choco/issues/194) + * When installing with *.nupkg, need to get package name from package, not file name - see [#90](https://github.com/chocolatey/choco/issues/90) + * Fix - Choco pin list is not returning a list - see [#302](https://github.com/chocolatey/choco/issues/302) + * Fix - A pin is not created for existing installations (prior to new choco) - see [#60](https://github.com/chocolatey/choco/issues/60) + +### IMPROVEMENTS + + * Allow upgrade to always install missing packages - see [#300](https://github.com/chocolatey/choco/issues/300) + * Enhance Templates - see [#296](https://github.com/chocolatey/choco/issues/296) + * Always log debug output to the log file - see [#319](https://github.com/chocolatey/choco/issues/319) + * Warn when unable to snapshot locked files - see [#313](https://github.com/chocolatey/choco/issues/313) + * Use %systemroot% in place of %windir%. PATH exceed 2048 breaks choco - see [#252](https://github.com/chocolatey/choco/issues/252) + ## [0.9.9.6](https://github.com/chocolatey/choco/issues?q=milestone%3A0.9.9.6+is%3Aclosed) (May 16, 2015) Some really large fixes this release, especially removing all files that are installed to the package directory if they haven't changed, including ensuring that the nupkg file is always removed on successful uninstalls. The really big add some folks are going to like is the new outdated command. Some more variables that were misused have been brought back, which allows some packages (like Atom) to be installed again without issue. If you can believe some people never read these, we decided to add a note to the installer prompt to let people know about -y. diff --git a/nuget/chocolatey/chocolatey.nuspec b/nuget/chocolatey/chocolatey.nuspec index daf354ef74..f9c21ca0ab 100644 --- a/nuget/chocolatey/chocolatey.nuspec +++ b/nuget/chocolatey/chocolatey.nuspec @@ -40,6 +40,45 @@ In that mess there is a link to the [Helper Reference](https://github.com/chocol See all - https://github.com/chocolatey/choco/blob/master/CHANGELOG.md +## 0.9.9.7 + +"Fix Everything. Fix All The Things" - There have been some things bugging us for a long time related to limitations with NuGet, so we decided to fix that. Like [nuspec enhancements](https://github.com/chocolatey/choco/issues/205), that crazy [content folder restriction](https://github.com/chocolatey/choco/issues/290) has been removed (I know, right?!), and we're working around [badly](https://github.com/chocolatey/choco/issues/316) [behaved](https://github.com/chocolatey/choco/issues/326) packages quite a bit more to bring you more feature parity. + +Let's talk about a couple of big, like really big, BIG features just added with this release. No more packages rebooting Windows. We fixed ([#304](https://github.com/chocolatey/choco/issues/304) / [#323](https://github.com/chocolatey/choco/issues/323)) and [enhanced](https://github.com/chocolatey/choco/issues/305) up the Auto Uninstaller Service quite a bit to ensure things are working like you would expect (It goes on by default in 0.9.10 - we'll start documenting more about it soon). But wait, there's more! I haven't even told you about the big features yet + +The first big feature is enhancing the nuspec. I mentioned this I know, but *now* you can use `packageSourceUrl` in the nuspec to tell folks where you are storing the source for the package! We also added `projectSourceUrl`, `docsUrl`, `mailingListUrl`, and `bugTrackerUrl`. What's even better is that the community feed has already been enhanced to look for these values. So have the templates from `choco new`. And it's backwards compatible, meaning you can still install packages that have these added nuspec enhancements without issue (but we will need to provide a fix for Nuget Package Explorer). + +The second is Xml Document Transformations (XDT), which I think many folks are aware of but may not realize what it can provide. [NuGet has allowed transformations for quite awhile](https://docs.nuget.org/Create/Configuration-File-and-Source-Code-Transformations) to allow you to make changes to an `app.config`/`web.config` on install/uninstall. We are following in similar footsteps to allow you to do similar when installing/upgrading packages. We will look for `*.install.xdt` files in the package (doesn't matter where) and they will apply to configuration files with the same name in the package. This means that during upgrades we won't overwrite configuration files during upgrades that have opted into this feature. It allows you to give users a better experience during upgrades because they won't need to keep making the same changes to the xml config files each time they upgrade your package. + +### FEATURES + + * Allow XDT Configuration Transforms - see [#331](https://github.com/chocolatey/choco/issues/331) + * Prevent reboots - see [#316](https://github.com/chocolatey/choco/issues/316) + * Enhance the nuspec - first wave - see [#205](https://github.com/chocolatey/choco/issues/205) + * Uninstaller Service Enhancements - see [#305](https://github.com/chocolatey/choco/issues/305) + +### BUG FIXES + + * When uninstall fails, do not continue removing files - see [#315](https://github.com/chocolatey/choco/issues/315) + * Do not run autouninstaller if the package result is already a failure - see [#323](https://github.com/chocolatey/choco/issues/323) + * Fix - Auto Uninstaller can fail if chocolateyUninstall.ps1 uninstalls prior to it running - see [#304](https://github.com/chocolatey/choco/issues/304) + * Fix - Packages with content folders cannot have a dependency without also having a content folder - see [#290](https://github.com/chocolatey/choco/issues/290) + * Remove ShimGen director files on upgrade/uninstall - see [#326](https://github.com/chocolatey/choco/issues/326) + * If feature doesn't exist, throw an error - see [#317](https://github.com/chocolatey/choco/issues/317) + * Fix - The operation completed successfully on stderr - see [#249](https://github.com/chocolatey/choco/issues/249) + * Fix - When specific nuget version is needed by a package it is the chocolatey version that is used - see [#194](https://github.com/chocolatey/choco/issues/194) + * When installing with *.nupkg, need to get package name from package, not file name - see [#90](https://github.com/chocolatey/choco/issues/90) + * Fix - Choco pin list is not returning a list - see [#302](https://github.com/chocolatey/choco/issues/302) + * Fix - A pin is not created for existing installations (prior to new choco) - see [#60](https://github.com/chocolatey/choco/issues/60) + +### IMPROVEMENTS + + * Allow upgrade to always install missing packages - see [#300](https://github.com/chocolatey/choco/issues/300) + * Enhance Templates - see [#296](https://github.com/chocolatey/choco/issues/296) + * Always log debug output to the log file - see [#319](https://github.com/chocolatey/choco/issues/319) + * Warn when unable to snapshot locked files - see [#313](https://github.com/chocolatey/choco/issues/313) + * Use %systemroot% in place of %windir%. PATH exceed 2048 breaks choco - see [#252](https://github.com/chocolatey/choco/issues/252) + ## 0.9.9.6 Some really large fixes this release, especially removing all files that are installed to the package directory if they haven't changed, including ensuring that the nupkg file is always removed on successful uninstalls. The really big add some folks are going to like is the new outdated command. Some more variables that were misused have been brought back, which allows some packages (like Atom) to be installed again without issue. If you can believe some people never read these, we decided to add a note to the installer prompt to let people know about -y. From 3cff29f4ce4732f92b19822a8efc00b372388b2a Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 20 Jun 2015 09:41:22 -0500 Subject: [PATCH 2/4] (GH-305) Fix: uninstaller confirm if no silent When the user selects `Yes`, proceed with the uninstaller. Otherwise skip. --- .../infrastructure.app/services/AutomaticUninstallerService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs b/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs index 5af7e8e4b0..f90f7d7cfc 100644 --- a/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs +++ b/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs @@ -131,6 +131,7 @@ public void run(PackageResult packageResult, ChocolateyConfiguration config) } var logLocation = _fileSystem.combine_paths(_fileSystem.get_full_path(config.CacheLocation), "chocolatey", pkgInfo.Package.Id, pkgInfo.Package.Version.to_string()); + this.Log().Debug(()=>" Setting up uninstall logging directory at {0}".format_with(logLocation)); _fileSystem.create_directory_if_not_exists(_fileSystem.get_directory_name(logLocation)); uninstallArgs = uninstallArgs.Replace(InstallTokens.PACKAGE_LOCATION, logLocation); @@ -142,7 +143,7 @@ public void run(PackageResult packageResult, ChocolateyConfiguration config) if (config.PromptForConfirmation) { var selection = InteractivePrompt.prompt_for_confirmation("Uninstall may not be silent (could not detect). Proceed?", new[] {"yes", "no"}, defaultChoice: null, requireAnswer: true); - if (selection.is_equal_to("no")) skipUninstaller = false; + if (selection.is_equal_to("yes")) skipUninstaller = false; } if (skipUninstaller) From 6ed67c8f5f7836e96e73972621c25ce55486d1ec Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 20 Jun 2015 09:43:28 -0500 Subject: [PATCH 3/4] (GH-337) Add fault tolerance to registry keys Sometimes there may be issues accessing a key in the registry, don't allow it to stop capturing a snapshot. `Requested registry access is not allowed` is the error seen with GH-335. --- .../services/RegistryService.cs | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/RegistryService.cs b/src/chocolatey/infrastructure.app/services/RegistryService.cs index e5ba45371f..bc39b54721 100644 --- a/src/chocolatey/infrastructure.app/services/RegistryService.cs +++ b/src/chocolatey/infrastructure.app/services/RegistryService.cs @@ -25,6 +25,7 @@ namespace chocolatey.infrastructure.app.services using domain; using filesystem; using infrastructure.services; + using tolerance; using Registry = domain.Registry; /// @@ -41,6 +42,14 @@ public RegistryService(IXmlService xmlService, IFileSystem fileSystem) _fileSystem = fileSystem; } + private void add_key(IList keys, RegistryHive hive, RegistryView view) + { + FaultTolerance.try_catch_with_logging_exception( + () => keys.Add(RegistryKey.OpenBaseKey(hive, view)), + "Could not open registry hive '{0}' for view '{1}'".format_with(hive.to_string(), view.to_string()), + logWarningInsteadOfError: true); + } + public Registry get_installer_keys() { var snapshot = new Registry(); @@ -50,16 +59,20 @@ public Registry get_installer_keys() IList keys = new List(); if (Environment.Is64BitOperatingSystem) { - keys.Add(RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry64)); - keys.Add(RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)); + add_key(keys, RegistryHive.CurrentUser, RegistryView.Registry64); + add_key(keys, RegistryHive.LocalMachine, RegistryView.Registry64); } - keys.Add(RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32)); - keys.Add(RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)); + add_key(keys, RegistryHive.CurrentUser, RegistryView.Registry32); + add_key(keys, RegistryHive.LocalMachine, RegistryView.Registry32); foreach (var registryKey in keys) { - var uninstallKey = registryKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", RegistryKeyPermissionCheck.ReadSubTree, RegistryRights.ReadKey); + var uninstallKey = FaultTolerance.try_catch_with_logging_exception( + () => registryKey.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", RegistryKeyPermissionCheck.ReadSubTree, RegistryRights.ReadKey), + "Could not open uninstall subkey for key '{0}'".format_with(registryKey.Name), + logWarningInsteadOfError: true); + if (uninstallKey != null) { //Console.WriteLine("Evaluating {0} of {1}".format_with(uninstallKey.View, uninstallKey.Name)); @@ -87,10 +100,21 @@ public Registry get_installer_keys() /// The snapshot. public void evaluate_keys(RegistryKey key, Registry snapshot) { - foreach (var subKeyName in key.GetSubKeyNames()) - { - evaluate_keys(key.OpenSubKey(subKeyName), snapshot); - } + if (key == null) return; + + FaultTolerance.try_catch_with_logging_exception( + () => + { + foreach (var subKeyName in key.GetSubKeyNames()) + { + FaultTolerance.try_catch_with_logging_exception( + () => evaluate_keys(key.OpenSubKey(subKeyName, RegistryKeyPermissionCheck.ReadSubTree, RegistryRights.ReadKey), snapshot), + "Failed to open subkey named '{0}' for '{1}', likely due to permissions".format_with(subKeyName, key.Name), + logWarningInsteadOfError: true); + } + }, + "Failed to open subkeys for '{0}', likely due to permissions".format_with(key.Name), + logWarningInsteadOfError: true); var appKey = new RegistryApplicationKey { From cce177c5f4f72c9a5ba9b225520c340e3df2e7bc Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 20 Jun 2015 09:47:45 -0500 Subject: [PATCH 4/4] (version) 0.9.9.7 --- .uppercut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.uppercut b/.uppercut index 87aa45f0e7..d9686134b0 100644 --- a/.uppercut +++ b/.uppercut @@ -18,7 +18,7 @@ - +