mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 23:29:00 +08:00
Merge pull request #636 from IMQS/BitsWorkaroundVSInstall
Add a workaround for another BITS code path
This commit is contained in:
commit
5b7dc56268
@ -20,7 +20,21 @@ $downloadPath = "$downloadsDir\$downloadName"
|
||||
|
||||
if (!(Test-Path $downloadPath))
|
||||
{
|
||||
Start-BitsTransfer -Source $url -Destination $downloadPath #-ErrorAction SilentlyContinue
|
||||
try {
|
||||
Start-BitsTransfer -Source $url -Destination $downloadPath -ErrorAction Stop
|
||||
}
|
||||
catch [System.Exception] {
|
||||
# If BITS fails for any reason, delete any potentially partially downloaded files and continue
|
||||
if (Test-Path $downloadPath)
|
||||
{
|
||||
Remove-Item $downloadPath
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(Test-Path $downloadPath))
|
||||
{
|
||||
Write-Host("Downloading $downloadName...")
|
||||
(New-Object System.Net.WebClient).DownloadFile($url, $downloadPath)
|
||||
}
|
||||
|
||||
$nugetOutput = & $nugetexe install Microsoft.VisualStudio.Setup.Configuration.Native -Pre -Source $downloadsDir -OutputDirectory $nugetPackageDir 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user