Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Commit

Permalink
adding -x86 parameter to force 32 bit packages
Browse files Browse the repository at this point in the history
 This closes #365
  • Loading branch information
ferventcoder committed Nov 9, 2013
1 parent 7e90c82 commit eca2dee
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BREAKING CHANGES:

FEATURES:

* Enhancement - Add switch to force x86 when packages have both versions - [#365](https://github.com/chocolatey/chocolatey/issues/365)

IMPROVEMENTS:

Expand Down
1 change: 1 addition & 0 deletions nuget/chocolatey.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ BREAKING CHANGES:

FEATURES:

* Enhancement - Add switch to force x86 when packages have both versions - [#365](https://github.com/chocolatey/chocolatey/issues/365)

IMPROVEMENTS:

Expand Down
10 changes: 9 additions & 1 deletion src/chocolatey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#[switch] $debug,
[string] $name,
[switch] $ignoreDependencies = $false,
[alias("x86")][switch] $forceX86 = $false,
[parameter(Position=1, ValueFromRemainingArguments=$true)]
[string[]]$packageNames=@('')
)
Expand Down Expand Up @@ -113,7 +114,14 @@ if ([Environment]::OSVersion.Version -lt (new-object 'Version' 6,0)){
#main entry point
Append-Log

Write-Debug "Arguments: `$command = '$command'|`$packageNames='$packageNames'|`$source='$source'|`$version='$version'|`$allVersions='$allVersions'|`$InstallArguments='$installArguments'|`$overrideArguments='$overrideArgs'|`$force='$force'|`$prerelease='$prerelease'|`$localonly='$localonly'|`$verbosity='$verbosity'|`$debug='$debug'|`$name='$name'|`$ignoreDependencies='$ignoreDependencies'"
Write-Debug "Arguments: `$command = '$command'|`$packageNames='$packageNames'|`$source='$source'|`$version='$version'|`$allVersions=$allVersions|`$InstallArguments='$installArguments'|`$overrideArguments=$overrideArgs|`$force=$force|`$prerelease=$prerelease|`$localonly=$localonly|`$verbosity=$verbosity|`$debug=$debug|`$name='$name'|`$ignoreDependencies=$ignoreDependencies|`$forceX86=$forceX86"

# run level environment variables
$env:chocolateyForceX86 = $null
if ($forceX86) {
$env:chocolateyForceX86 = $true
}


$chocolateyErrored = $false
$badPackages = ''
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/functions/Get-ChocolateyWebFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ param(
$url = $url64bit;
}

$forceX86 = $env:chocolateyForceX86;
if ($forceX86) {
Write-Debug "User specified -x86 so forcing 32 bit"
$bitPackage = 32
$url = $url32bit
}

Write-Host "Downloading $packageName $bitPackage bit ($url) to $fileFullPath"
#$downloader = new-object System.Net.WebClient
#$downloader.DownloadFile($url, $fileFullPath)
Expand Down

0 comments on commit eca2dee

Please sign in to comment.