diff --git a/CHANGELOG.md b/CHANGELOG.md index 999178aa87..86be86d75f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ If you were using any of the functions in a non-recommended way or not compliant * Mark packages pending until install completes successfully - see [#198](https://github.com/chocolatey/choco/issues/198) * Resolve sources by name - see [#356](https://github.com/chocolatey/choco/issues/356) * Uninstall-ChocolateyEnvironmentVariable function - see [#772](https://github.com/chocolatey/choco/issues/772) + * Get-UninstallRegistryKey function - see [#739](https://github.com/chocolatey/choco/issues/739) * Pro/Business - Ubiquitous Install Directory Switch - see [#258](https://github.com/chocolatey/choco/issues/258) * Pro/Business - Runtime Virus Scanning - see [virus scanning](https://chocolatey.org/docs/features-virus-check) * Pro/Business - Private CDN cache for downloads - see [private CDN cache](https://chocolatey.org/docs/features-private-cdn) @@ -127,7 +128,8 @@ If you were using any of the functions in a non-recommended way or not compliant * Fix - Logging of upgrade messages - placement of some messages is incorrect - see [#557](https://github.com/chocolatey/choco/issues/557) * Fix - Get-WebFile fails with - The term '//continue' is not recognized as the name of a cmdlet - see [#789](https://github.com/chocolatey/choco/issues/789) * Fix - Unable to read registry snapshot file - see [#487](https://github.com/chocolatey/choco/issues/487) - + * Fix - Uninstall template fails when encountering "bad" registry keys - see [#739](https://github.com/chocolatey/choco/issues/739) + ### IMPROVEMENTS * AutoUninstaller is on by default - see [#308](https://github.com/chocolatey/choco/issues/308) diff --git a/docs/generated/HelpersGetUninstallRegistryKey.md b/docs/generated/HelpersGetUninstallRegistryKey.md new file mode 100644 index 0000000000..6f5c5d2839 --- /dev/null +++ b/docs/generated/HelpersGetUninstallRegistryKey.md @@ -0,0 +1,119 @@ +# Get-UninstallRegistryKey + +Retrieve registry key(s) for system-installed applications from an +exact or wildcard search. + +## Syntax + +~~~powershell +Get-UninstallRegistryKey ` + -SoftwareName ` + [-IgnoredArguments ] [] +~~~ + +## Description + +This function will attempt to retrieve a matching registry key for an +already installed application, usually to be used with a +chocolateyUninstall.ps1 automation script. + +The function also prevents `Get-ItemProperty` from failing when +handling wrongly encoded registry keys. + +## Notes + +Available in 0.9.10+. If you need to maintain compatibility with pre +0.9.10, please add the following to your nuspec: + +~~~xml + + + +~~~ + +## Aliases + +`Get-InstallRegistryKey` + + +## Examples + + **EXAMPLE 1** + +~~~powershell + +# Software name in Programs and Features is "Gpg4Win (2.3.0)" +[array]$key = Get-UninstallRegistryKey -SoftwareName "Gpg4win*" +$key.DisplayName +~~~ + +**EXAMPLE 2** + +~~~powershell + +# Software name is "Launchy 2.5" +[array]$key = Get-UninstallRegistryKey -SoftwareName "Launchy*" +$key.UninstallString +~~~ + +**EXAMPLE 3** + +~~~powershell + +# Software name is "Mozilla Firefox" +[array]$key = Get-UninstallRegistryKey -SoftwareName "Mozilla Firefox" +$key.UninstallString +~~~ + +## Inputs + +None + +## Outputs + +None + +## Parameters + +### -SoftwareName <String> +Part or all of the Display Name as you see it in Programs and Features. +It should be enough to be unique. + +If the display name contains a version number, such as "Launchy 2.5", +it is recommended you use a fuzzy search "Launchy*" (the wildcard '*') +as if the version is upgraded or autoupgraded, suddenly the uninstall +script will stop working and it may not be clear as to what went wrong +at first. + +Property | Value +---------------------- | -------------- +Aliases | +Required? | true +Position? | 1 +Default Value | +Accept Pipeline Input? | true (ByValue) + +### -IgnoredArguments [<Object[]>] +Property | Value +---------------------- | ----- +Aliases | +Required? | false +Position? | named +Default Value | +Accept Pipeline Input? | false + +### <CommonParameters> + +This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see `about_CommonParameters` http://go.microsoft.com/fwlink/p/?LinkID=113216 . + + +## Links + + * [[Install-ChocolateyPackage|HelpersInstallChocolateyPackage]] + * [[Install-ChocolateyInstallPackage|HelpersInstallChocolateyInstallPackage]] + * [[Uninstall-ChocolateyPackage|HelpersUninstallChocolateyPackage]] + + +[[Function Reference|HelpersReference]] + +***NOTE:*** This documentation has been automatically generated from `Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Get-UninstallRegistryKey -Full`. diff --git a/docs/generated/HelpersInstallChocolateyInstallPackage.md b/docs/generated/HelpersInstallChocolateyInstallPackage.md index 8fe74994a2..9099bf7f7c 100644 --- a/docs/generated/HelpersInstallChocolateyInstallPackage.md +++ b/docs/generated/HelpersInstallChocolateyInstallPackage.md @@ -215,6 +215,7 @@ This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -Err * [[Install-ChocolateyPackage|HelpersInstallChocolateyPackage]] * [[Uninstall-ChocolateyPackage|HelpersUninstallChocolateyPackage]] + * [[Get-UninstallRegistryKey|HelpersGetUninstallRegistryKey]] * [[Start-ChocolateyProcessAsAdmin|HelpersStartChocolateyProcessAsAdmin]] diff --git a/docs/generated/HelpersInstallChocolateyPackage.md b/docs/generated/HelpersInstallChocolateyPackage.md index bce165bbd0..6c12514378 100644 --- a/docs/generated/HelpersInstallChocolateyPackage.md +++ b/docs/generated/HelpersInstallChocolateyPackage.md @@ -348,6 +348,7 @@ This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -Err * [[Get-ChocolateyWebFile|HelpersGetChocolateyWebFile]] * [[Install-ChocolateyInstallPackage|HelpersInstallChocolateyInstallPackage]] + * [[Get-UninstallRegistryKey|HelpersGetUninstallRegistryKey]] * [[Install-ChocolateyZipPackage|HelpersInstallChocolateyZipPackage]] diff --git a/docs/generated/HelpersReference.md b/docs/generated/HelpersReference.md index 5663c10038..4b664e24f2 100644 --- a/docs/generated/HelpersReference.md +++ b/docs/generated/HelpersReference.md @@ -61,6 +61,7 @@ These are the functions from above as one list. * [[Get-OSArchitectureWidth|HelpersGetOSArchitectureWidth]] * [[Get-ToolsLocation|HelpersGetToolsLocation]] * [[Get-UACEnabled|HelpersGetUACEnabled]] + * [[Get-UninstallRegistryKey|HelpersGetUninstallRegistryKey]] * [[Get-VirusCheckValid|HelpersGetVirusCheckValid]] * [[Get-WebFile|HelpersGetWebFile]] * [[Get-WebFileName|HelpersGetWebFileName]] diff --git a/docs/generated/HelpersUninstallChocolateyPackage.md b/docs/generated/HelpersUninstallChocolateyPackage.md index 61cd433f75..b895255382 100644 --- a/docs/generated/HelpersUninstallChocolateyPackage.md +++ b/docs/generated/HelpersUninstallChocolateyPackage.md @@ -163,6 +163,7 @@ This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -Err * [[Install-ChocolateyPackage|HelpersInstallChocolateyPackage]] * [[Install-ChocolateyInstallPackage|HelpersInstallChocolateyInstallPackage]] * [[Uninstall-ChocolateyZipPackage|HelpersUninstallChocolateyZipPackage]] + * [[Get-UninstallRegistryKey|HelpersGetUninstallRegistryKey]] [[Function Reference|HelpersReference]] diff --git a/nuget/chocolatey/chocolatey.nuspec b/nuget/chocolatey/chocolatey.nuspec index 4221ce2b25..70024d4744 100644 --- a/nuget/chocolatey/chocolatey.nuspec +++ b/nuget/chocolatey/chocolatey.nuspec @@ -118,6 +118,7 @@ If you were using any of the functions in a non-recommended way or not compliant * Mark packages pending until install completes successfully - see [#198](https://github.com/chocolatey/choco/issues/198) * Resolve sources by name - see [#356](https://github.com/chocolatey/choco/issues/356) * Uninstall-ChocolateyEnvironmentVariable function - see [#772](https://github.com/chocolatey/choco/issues/772) + * Get-UninstallRegistryKey function - see [#739](https://github.com/chocolatey/choco/issues/739) * Pro/Business - Ubiquitous Install Directory Switch - see [#258](https://github.com/chocolatey/choco/issues/258) * Pro/Business - Runtime Virus Scanning - see [virus scanning](https://chocolatey.org/docs/features-virus-check) * Pro/Business - Private CDN cache for downloads - see [private CDN cache](https://chocolatey.org/docs/features-private-cdn) @@ -182,7 +183,8 @@ If you were using any of the functions in a non-recommended way or not compliant * Fix - Logging of upgrade messages - placement of some messages is incorrect - see [#557](https://github.com/chocolatey/choco/issues/557) * Fix - Get-WebFile fails with - The term '//continue' is not recognized as the name of a cmdlet - see [#789](https://github.com/chocolatey/choco/issues/789) * Fix - Unable to read registry snapshot file - see [#487](https://github.com/chocolatey/choco/issues/487) - + * Fix - Uninstall template fails when encountering "bad" registry keys - see [#739](https://github.com/chocolatey/choco/issues/739) + ### IMPROVEMENTS * AutoUninstaller is on by default - see [#308](https://github.com/chocolatey/choco/issues/308) diff --git a/src/chocolatey.resources/chocolatey.resources.csproj b/src/chocolatey.resources/chocolatey.resources.csproj index 5c532e0833..ae480f3f80 100644 --- a/src/chocolatey.resources/chocolatey.resources.csproj +++ b/src/chocolatey.resources/chocolatey.resources.csproj @@ -149,6 +149,9 @@ + + + + -->