Commit e72f33c4 authored by Tim Smith's avatar Tim Smith
Browse files

Update to the latest install script


Signed-off-by: default avatarTim Smith <tsmith@chef.io>
parent ae4a7d48
# =====================================================================
# Copyright 2011 - Present RealDimensions Software, LLC, and the
# Copyright 2017 Chocolatey Software, Inc, and the
# original authors/contributors from ChocolateyGallery
# Copyright 2011 - 2017 RealDimensions Software, LLC, and the
# original authors/contributors from ChocolateyGallery
# at https://github.com/chocolatey/chocolatey.org
#
......@@ -44,10 +46,14 @@ if ($env:TEMP -eq $null) {
}
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "chocInstall"
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
if (![System.IO.Directory]::Exists($tempDir)) {[void][System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $tempDir "chocolatey.zip"
# PowerShell v2/3 caches the output stream. Then it throws errors due # to the FileStream not being what is expected. Fixes "The OS handle's # position is not what FileStream expected. Do not use a handle # simultaneously in one FileStream and in Win32 code or another # FileStream."
# PowerShell v2/3 caches the output stream. Then it throws errors due
# to the FileStream not being what is expected. Fixes "The OS handle's
# position is not what FileStream expected. Do not use a handle
# simultaneously in one FileStream and in Win32 code or another
# FileStream."
function Fix-PowerShellOutputRedirectionBug {
$poshMajorVerion = $PSVersionTable.PSVersion.Major
......@@ -179,8 +185,8 @@ $useWindowsCompression = $env:chocolateyUseWindowsCompression
if ($useWindowsCompression -ne $null -and $useWindowsCompression -eq 'true') {
Write-Output 'Using built-in compression to unzip'
$unzipMethod = 'builtin'
} else {
Write-Output "Downloading 7-Zip commandline tool prior to extraction."
} elseif (-Not (Test-Path ($7zaExe))) {
Write-Output "Downloading 7-Zip commandline tool prior to extraction."
# download 7zip
Download-File 'https://chocolatey.org/7za.exe' "$7zaExe"
}
......@@ -244,7 +250,11 @@ Write-Output 'Ensuring chocolatey commands are on the path'
$chocInstallVariableName = "ChocolateyInstall"
$chocoPath = [Environment]::GetEnvironmentVariable($chocInstallVariableName)
if ($chocoPath -eq $null -or $chocoPath -eq '') {
$chocoPath = 'C:\ProgramData\Chocolatey'
$chocoPath = "$env:ALLUSERSPROFILE\Chocolatey"
}
if (!(Test-Path ($chocoPath))) {
$chocoPath = "$env:SYSTEMDRIVE\ProgramData\Chocolatey"
}
$chocoExePath = Join-Path $chocoPath 'bin'
......@@ -260,10 +270,10 @@ if (![System.IO.Directory]::Exists($chocoPkgDir)) { [System.IO.Directory]::Creat
Copy-Item "$file" "$nupkg" -Force -ErrorAction SilentlyContinue
# SIG # Begin signature block
# MIINWwYJKoZIhvcNAQcCoIINTDCCDUgCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# MIINVQYJKoZIhvcNAQcCoIINRjCCDUICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBlBAdKza9HJh5y
# SStdXAQqtPBJqqekYVu4kBAl52mATaCCCngwggUwMIIEGKADAgECAhAECRgbX9W7
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBtI1XhNa+BTJDA
# Udd7cvDCY121zDB7LmEXLgQMpQmPnqCCCnIwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
......@@ -291,45 +301,45 @@ Copy-Item "$file" "$nupkg" -Force -ErrorAction SilentlyContinue
# r7VRwo0kriTGxycqoSkoGjpxKAI8LpGjwCUR4pwUR6F6aG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7MmSJkCga40y02t0OTR8w+V8Ev4GPL47Ubu3fLetknY2Z5r+b1+eu
# camDGbsbstoG
# SIG # End signature block
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment