Merge pull request #665 from cmderdev/martiuk-dev

Build from behind proxy & appveyor
This commit is contained in:
Martin Kemp
2015-10-16 11:02:33 +01:00
4 changed files with 57 additions and 2 deletions

View File

@ -74,7 +74,7 @@ if ($config -ne "") {
} else { $ConEmuXml = "" }
} else { $ConEmuXml = "" }
$vend = $pwd
foreach ($s in $sources) {
Write-Verbose "Getting $($s.name) from URL $($s.url)"
@ -83,7 +83,7 @@ foreach ($s in $sources) {
Delete-Existing $tempArchive
Delete-Existing $s.name
Invoke-WebRequest -Uri $s.url -OutFile $tempArchive -ErrorAction Stop
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
Extract-Archive $tempArchive $s.name
if ((Get-Childitem $s.name).Count -eq 1) {

View File

@ -89,3 +89,16 @@ function Register-Cmder(){
New-Item -Path "HKCR:\Directory\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
}
}
function Download-File {
param (
$Url,
$File
)
# I think this is the problem
$File = $File -Replace "/", "\"
Write-Verbose "Downloading from $Url to $File"
$wc = new-object System.Net.WebClient
$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.DownloadFile($Url, $File)
}