From 4a98050fd3f4942fdaa5e17f3d2db48a2c96e88b Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Sat, 20 Feb 2016 18:01:01 -0600 Subject: [PATCH] (GH-642) Show bitness downloading msg when both 32/64 `Downloading packagename 32 bit` is confusing for some when they are on 64 bit Windows and want the 64 bit version. Many times there is only a 32 bit version available (which works fine), so the message shouldn't show unless there are both downloads available and the user has forced 32 bit or is on a 32 bit system. --- .../helpers/functions/Get-ChocolateyWebFile.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 index 011370d0e1..76201956a3 100644 --- a/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-ChocolateyWebFile.ps1 @@ -100,10 +100,12 @@ param( } Write-Debug "CPU is $bitWidth bit" - $bitPackage = 32 + $bitPackage = '' + if ($url32bit -ne $url64bit -and $url64bit -ne $null -and $url64bit -ne '') { $bitPackage = '32 bit' } + if ($bitWidth -eq 64 -and $url64bit -ne $null -and $url64bit -ne '') { Write-Debug "Setting url to '$url64bit' and bitPackage to $bitWidth" - $bitPackage = $bitWidth + $bitPackage = '64 bit' $url = $url64bit; # only set if urls are different if ($url32bit -ne $url64bit) { @@ -117,7 +119,7 @@ param( $forceX86 = $env:chocolateyForceX86; if ($forceX86) { Write-Debug "User specified -x86 so forcing 32 bit" - $bitPackage = 32 + if ($url32bit -ne $url64bit) { $bitPackage = '32 bit' } $url = $url32bit $checksum = $checksum32 $checksumType = $checksumType32 @@ -171,7 +173,7 @@ param( } if ($needsDownload) { - Write-Host "Downloading $packageName $bitPackage bit + Write-Host "Downloading $packageName $bitPackage from `'$url`'" Get-WebFile $url $fileFullPath -options $options }