diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-03 21:05:31 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-06 17:24:45 -0700 |
| commit | 31377dee20dad9b95357934732996e2448f2eaf5 (patch) | |
| tree | 770015c4607ba633588ee3c1364544f2949026f9 /scripts/fetchTool.ps1 | |
| parent | 997fddb3c1a3acb7579e1fe0ab82436b227a0dc4 (diff) | |
| download | vcpkg-31377dee20dad9b95357934732996e2448f2eaf5.tar.gz vcpkg-31377dee20dad9b95357934732996e2448f2eaf5.zip | |
Use 7z for extracting. Extract tools in downloads/tools
Diffstat (limited to 'scripts/fetchTool.ps1')
| -rw-r--r-- | scripts/fetchTool.ps1 | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 26eedac3b..315983841 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -25,7 +25,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) throw "Unkown tool $tool" } - $exePath = "$downloadsDir\$($toolData.exeRelativePath)" + $toolPath="$downloadsDir\tools\$tool-$($toolData.requiredVersion)-windows" + $exePath = "$toolPath\$($toolData.exeRelativePath)" if (Test-Path $exePath) { @@ -39,7 +40,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) } else { - $downloadPath = "$downloadsDir\$($toolData.exeRelativePath)" + $downloadPath = "$toolPath\$($toolData.exeRelativePath)" } [String]$url = $toolData.url @@ -56,9 +57,22 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { - $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." - vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename + if ($tool -eq "7zip") + { + $sevenZipR = fetchToolInternal "7zr" + $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + if ($ec -ne 0) + { + Write-Host "Could not extract $downloadPath" + throw + } + } + else + { + $sevenZipExe = fetchToolInternal "7zip" + vcpkgExtractFile -sevenZipExe "$sevenZipExe" -ArchivePath $downloadPath -DestinationDir $toolPath + } Write-Host "Extracting $tool... done." } |
