From 5890c909281adb7de7f4b824ee4ca7de616fc29d Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 11 Apr 2016 12:20:35 -0500 Subject: [PATCH 1/3] (doc) update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa5a2b71c3..69d664d77e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Here's one you probably never knew existed - extensions. Chocolatey has had the We redesigned our `choco new` default packaging template and we've made managing templates as easy as managing packages. -`choco search`/`choco list` got so many enhancements, you may not need to visit dot org again. [See it in action](https://github.com/chocolatey/choco/wiki/CommandsList#see-it-in-action). +`choco search`/`choco list` has so many enhancements, you may not need to visit dot org again. [See it in action](https://github.com/chocolatey/choco/wiki/CommandsList#see-it-in-action). * [search -v provides moderation related information and a world of nuspec information](https://github.com/chocolatey/choco/issues/493) * [search by id only](https://github.com/chocolatey/choco/issues/663) * [search by id exact](https://github.com/chocolatey/choco/issues/453) From 9c3f5d087d38689064bc9d92f2b364005d0875d4 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 11 Apr 2016 12:21:25 -0500 Subject: [PATCH 2/3] (GH-303) Additional fixes for process env vars Process environment variables should be returned immediately --- .../helpers/functions/Get-EnvironmentVariable.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chocolatey.resources/helpers/functions/Get-EnvironmentVariable.ps1 b/src/chocolatey.resources/helpers/functions/Get-EnvironmentVariable.ps1 index c4e328d79b..5f89044ba7 100644 --- a/src/chocolatey.resources/helpers/functions/Get-EnvironmentVariable.ps1 +++ b/src/chocolatey.resources/helpers/functions/Get-EnvironmentVariable.ps1 @@ -51,7 +51,7 @@ param( [string] $USER_ENVIRONMENT_REGISTRY_KEY_NAME = "Environment"; [Microsoft.Win32.RegistryKey] $win32RegistryKey = [Microsoft.Win32.Registry]::CurrentUser.OpenSubKey($USER_ENVIRONMENT_REGISTRY_KEY_NAME) } elseif ($Scope -eq [System.EnvironmentVariableTarget]::Process) { - [Environment]::GetEnvironmentVariable($Name, $Scope) + return [Environment]::GetEnvironmentVariable($Name, $Scope) } [Microsoft.Win32.RegistryValueOptions] $registryValueOptions = [Microsoft.Win32.RegistryValueOptions]::None @@ -64,7 +64,7 @@ param( [string] $environmentVariableValue = [string]::Empty try { - Write-Verbose "Getting environment variable $Name" + #Write-Verbose "Getting environment variable $Name" $environmentVariableValue = $win32RegistryKey.GetValue($Name, [string]::Empty, $registryValueOptions) } catch { Write-Debug "Unable to retrieve the $Name environment variable. Details: $_" From fd2eea1fb9f351a7f54547da0754625fe0f82f24 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 11 Apr 2016 12:28:46 -0500 Subject: [PATCH 3/3] (maint) installer messages / checks - Add debug messages for installing the profile - .NET Framework 4 install - Check for c:\Windows in case environment variable is hosed - .NET Fx install - check that we haven't gone over 2 tries instead of exactly two. - Update messaging on .NET Fx install attempts --- nuget/chocolatey/tools/chocolateysetup.psm1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nuget/chocolatey/tools/chocolateysetup.psm1 b/nuget/chocolatey/tools/chocolateysetup.psm1 index 18424be4f3..52f9d9ea75 100644 --- a/nuget/chocolatey/tools/chocolateysetup.psm1 +++ b/nuget/chocolatey/tools/chocolateysetup.psm1 @@ -487,15 +487,18 @@ function Get-FileEncoding($Path) { } function Add-ChocolateyProfile { + Write-Debug "Add-ChocolateyProfile" try { $profileFile = "$profile" $profileDirectory = (Split-Path -Parent $profileFile) if (!(Test-Path($profileDirectory))) { + Write-Debug "Creating '$profileDirectory'" New-Item "$profileDirectory" -Type Directory -Force -ErrorAction SilentlyContinue | Out-Null } if (!(Test-Path($profileFile))) { + Write-Debug "Creating '$profileFile'" "" | Out-File $profileFile -Encoding UTF8 } @@ -547,8 +550,9 @@ param( # we can't take advantage of any chocolatey module functions, because they # haven't been unpacked because they require .NET Framework 4.0 - Write-Debug "Install-DotNet4IfMissing" - if ([IntPtr]::Size -eq 8) {$fx="framework64"} else {$fx="framework"} + Write-Debug "Install-DotNet4IfMissing called with `$forceFxInstall=$forceFxInstall" + $NetFxArch = "Framework" + if ([IntPtr]::Size -eq 8) {$NetFxArch="Framework64" } $NetFx4ClientUrl = 'http://download.microsoft.com/download/5/6/2/562A10F9-C9F4-4313-A044-9C94E0A8FAC8/dotNetFx40_Client_x86_x64.exe' $NetFx4FullUrl = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe' @@ -557,7 +561,8 @@ param( $NetFx4InstallerFile = 'dotNetFx40_Full_x86_x64.exe' $NetFx4Installer = Join-Path $NetFx4Path $NetFx4InstallerFile - if(!(test-path "$env:windir\Microsoft.Net\$fx\v4.0.30319") -or $forceFxInstall) { + if ((!(Test-Path "$env:SystemRoot\Microsoft.Net\$NetFxArch\v4.0.30319") -and !(Test-Path "C:\Windows\Microsoft.Net\$NetFxArch\v4.0.30319")) -or $forceFxInstall) { + Write-Output "'$env:SystemRoot\Microsoft.Net\$NetFxArch\v4.0.30319' was not found or this is forced" if (!(Test-Path $NetFx4Path)) { Write-Output "Creating folder `'$NetFx4Path`'" $null = New-Item -Path "$NetFx4Path" -ItemType Directory @@ -582,11 +587,11 @@ param( $s = [System.Diagnostics.Process]::Start($psi); $s.WaitForExit(); if ($s.ExitCode -ne 0 -and $s.ExitCode -ne 3010) { - if ($netFx4InstallTries -eq 2) { + if ($netFx4InstallTries -ge 2) { Write-ChocolateyError ".NET Framework install failed with exit code `'$($s.ExitCode)`'. `n This will cause the rest of the install to fail." throw "Error installing .NET Framework 4.0 (exit code $($s.ExitCode)). `n Please install the .NET Framework 4.0 manually and then try to install Chocolatey again. `n Download at `'$NetFx4Url`'" } else { - Write-ChocolateyWarning "First try of .NET framework install failed with exit code `'$($s.ExitCode)`'. Trying again." + Write-ChocolateyWarning "Try #$netFx4InstallTries of .NET framework install failed with exit code `'$($s.ExitCode)`'. Trying again." Install-DotNet4IfMissing $true } }