Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
* stable:
  (GH-274) Clean up how debugMode is expressed
  (GH-274) Allow unattended installs as non-admin user
  (GH-281) Fix notsilent switch
  • Loading branch information
ferventcoder committed May 16, 2015
2 parents e2c46c3 + ae68a69 commit edaa44c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
16 changes: 4 additions & 12 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $sysDrive = $env:SystemDrive
$tempDir = $env:TEMP
$defaultChocolateyPathOld = "$sysDrive\Chocolatey"
#$ErrorActionPreference = 'Stop'
$debugMode = $false
$debugModeParams = ""

function Initialize-Chocolatey {
<#
Expand Down Expand Up @@ -34,17 +34,13 @@ param(
Write-Debug "Initialize-Chocolatey"

if ($env:ChocolateyEnvironmentDebug -eq 'true') {
$debugMode = $true
$debugModeParams = "dv"
}

Install-DotNet4IfMissing

$chocoNew = Join-Path $thisScriptFolder 'chocolateyInstall\choco.exe'
if ($debugMode) {
& $chocoNew unpackself -fdv
} else {
& $chocoNew unpackself -f
}
& $chocoNew unpackself -fy$debugModeParams

$installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1'
Import-Module $installModule -Force
Expand Down Expand Up @@ -313,11 +309,7 @@ param(
$chocoExeDest = Join-Path $chocolateyPath 'choco.exe'
Copy-Item $chocoExe $chocoExeDest -force

if ($debugMode) {
& $chocoExeDest unpackself -fdv
} else {
& $chocoExeDest unpackself -f
}
& $chocoExeDest unpackself -fy$debugModeParams
}

function Ensure-ChocolateyLibFiles {
Expand Down
10 changes: 4 additions & 6 deletions src/chocolatey/infrastructure.app/services/PowershellService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,10 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack

Environment.SetEnvironmentVariable("TEMP", configuration.CacheLocation);

//verify how not silent is passed
//if (configuration.NotSilent)
//{
// Environment.SetEnvironmentVariable("installerArguments", " ");
// Environment.SetEnvironmentVariable("chocolateyInstallOverride", "true");
//}
if (configuration.NotSilent)
{
Environment.SetEnvironmentVariable("chocolateyInstallOverride", "true");
}
if (configuration.Debug)
{
Environment.SetEnvironmentVariable("ChocolateyEnvironmentDebug", "true");
Expand Down

0 comments on commit edaa44c

Please sign in to comment.