Skip to content

Commit

Permalink
(GH-207) Some pkgs incorrectly use arguments
Browse files Browse the repository at this point in the history
* Set $installArguments to the environment variable
* Set $forcex86 to the environment variable
* Set $packageParameters to the environment variable
* Set $overrideArgs to the environment variable
  • Loading branch information
ferventcoder committed Mar 27, 2015
1 parent b183bfa commit abe92f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/chocolatey.resources/helpers/chocolateyInstaller.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ if ($env:ChocolateyEnvironmentDebug -eq 'true') { $DebugPreference = "Continue";
$VerbosePreference = "SilentlyContinue"
if ($env:ChocolateyEnvironmentVerbose -eq 'true') { $VerbosePreference = "Continue"; $verbosity = $true }

$installArguments = $env:chocolateyInstallArguments

$overrideArgs = false
if ($env:chocolateyInstallOverride -eq 'true') { $overrideArgs = true }

$forceX86 = false
if ($env:chocolateyForceX86 -eq 'true') { $forceX86 = true }

This comment has been minimized.

Copy link
@ferventcoder

ferventcoder Mar 30, 2015

Author Member

Ugh - works in POSH v2 but no other version. I thought I caught testing in other POSHs, but apparently not. :/ #215 & #216


$packageParameters = $env:chocolateyPackageParameters

# ensure module loading preference is on
$PSModuleAutoLoadingPreference = "All";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack
Environment.SetEnvironmentVariable("packageVersion", package.Version.to_string());
Environment.SetEnvironmentVariable("chocolateyPackageFolder", packageDirectory);
Environment.SetEnvironmentVariable("packageFolder", packageDirectory);
Environment.SetEnvironmentVariable("installArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("installerArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("chocolateyInstallArguments", configuration.InstallArguments);
Environment.SetEnvironmentVariable("packageParameters", configuration.PackageParameters);
Environment.SetEnvironmentVariable("chocolateyPackageParameters", configuration.PackageParameters);
if (configuration.ForceX86)
{
Expand Down

3 comments on commit abe92f3

@gep13
Copy link
Member

@gep13 gep13 commented on abe92f3 Mar 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ferventcoder seems like the easier route to take, than to try to chase package maintainers to not use that variable. 👍

@ferventcoder
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well you should see the other commits - ugh

@gep13
Copy link
Member

@gep13 gep13 commented on abe92f3 Mar 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Missed the other commits :-(

Please sign in to comment.