diff --git a/nuget/chocolatey/tools/chocolateysetup.psm1 b/nuget/chocolatey/tools/chocolateysetup.psm1 index 9722773b4b..5e3440796a 100644 --- a/nuget/chocolatey/tools/chocolateysetup.psm1 +++ b/nuget/chocolatey/tools/chocolateysetup.psm1 @@ -4,7 +4,7 @@ $sysDrive = $env:SystemDrive $tempDir = $env:TEMP $defaultChocolateyPathOld = "$sysDrive\Chocolatey" #$ErrorActionPreference = 'Stop' -$debugMode = $false +$debugModeParams = "" function Initialize-Chocolatey { <# @@ -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 @@ -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 { diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 80d5f10246..223cc6fd4c 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -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");