Skip to content

Commit

Permalink
(GH-642) Show bitness downloading msg when both 32/64
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
ferventcoder committed Feb 21, 2016
1 parent d5cd67f commit 4a98050
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 4a98050

Please sign in to comment.