From bbcef6843d115a7fe930ade5bf78355d3dadcfab Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Wed, 7 Oct 2015 12:04:43 -0500 Subject: [PATCH] (version) 0.9.10-beta1 (GH-460) Amended Template Using 'choco new' to produce ChocolateyUninstall.ps1 for your package would result in the uninstall block never being executed as the $key variable type was wrong. Updated the script template to force the $key variable to always be an array and therefore have a Count method that can be evaluated and the uninstall block executed. Closes #460 --- .uppercut | 2 +- .../infrastructure.app/templates/ChocolateyUninstallTemplate.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.uppercut b/.uppercut index a9da054bf3..d2fbe2f473 100644 --- a/.uppercut +++ b/.uppercut @@ -19,7 +19,7 @@ - + diff --git a/src/chocolatey/infrastructure.app/templates/ChocolateyUninstallTemplate.cs b/src/chocolatey/infrastructure.app/templates/ChocolateyUninstallTemplate.cs index f871d546ac..9f1369052c 100644 --- a/src/chocolatey/infrastructure.app/templates/ChocolateyUninstallTemplate.cs +++ b/src/chocolatey/infrastructure.app/templates/ChocolateyUninstallTemplate.cs @@ -58,7 +58,7 @@ public class ChocolateyUninstallTemplate $machine_key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' $machine_key6432 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' -$key = Get-ItemProperty -Path @($machine_key6432,$machine_key, $local_key) ` +[array]$key = Get-ItemProperty -Path @($machine_key6432,$machine_key, $local_key) ` -ErrorAction SilentlyContinue ` | ? { $_.DisplayName -like ""$softwareName"" }