aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-02-06 12:32:39 -0800
committerGitHub <noreply@github.com>2017-02-06 12:32:39 -0800
commit5b7dc5626828bf452080f5906f3cfc5c68b05ba2 (patch)
treec6c41cdc5545bdef4259f258d563ccf962644417 /scripts
parentce477bf21998c80afc551de72c6140178de3a114 (diff)
parent504545d2c864623ebddf169b1e402326bfe136f4 (diff)
downloadvcpkg-5b7dc5626828bf452080f5906f3cfc5c68b05ba2.tar.gz
vcpkg-5b7dc5626828bf452080f5906f3cfc5c68b05ba2.zip
Merge pull request #636 from IMQS/BitsWorkaroundVSInstall
Add a workaround for another BITS code path
Diffstat (limited to 'scripts')
-rw-r--r--scripts/findVisualStudioInstallationInstances.ps116
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/findVisualStudioInstallationInstances.ps1 b/scripts/findVisualStudioInstallationInstances.ps1
index a2ce66522..9d54990a2 100644
--- a/scripts/findVisualStudioInstallationInstances.ps1
+++ b/scripts/findVisualStudioInstallationInstances.ps1
@@ -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