From 8a8bd498c2e4078328195926bb90db019ae1ba62 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 2 May 2015 11:07:19 -0500 Subject: [PATCH] (GH-253) Fix Zip ChecksumType is ignored Due to defaulting `$url64bit` to `$url`, `$checksumType` was converting to the 64 bit checksumtype, even if it was empty. Which causes checksumtype to default to md5, no matter what the checksumtype passed in is. Move the checksumType setting for x64 into the check if the urls for 32 bit and 64 bit are different. Additionally, ensure that the checksumtype64 is not empty. --- .../helpers/functions/Get-ChocolateyWebFile.ps1 | 5 +++-- .../helpers/functions/Install-ChocolateyZipPackage.ps1 | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 index 217d19a0c2..ad83d67d51 100644 --- a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 @@ -85,9 +85,10 @@ param( # only set if urls are different if ($url32bit -ne $url64bit) { $checksum = $checksum64 + if ($checkSumType64 -ne '') { + $checksumType = $checksumType64 + } } - - $checksumType = $checksumType64 } try { diff --git a/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 b/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 index 0d9cea1315..63223ba8be 100644 --- a/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 +++ b/src/chocolatey.resources/helpers/functions/Install-ChocolateyZipPackage.ps1 @@ -63,7 +63,7 @@ param( [string] $packageName, [string] $url, [string] $unzipLocation, - [string] $url64bit = $url, + [string] $url64bit = '', [string] $specificFolder ="", [string] $checksum = '', [string] $checksumType = '',