diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-04 19:26:14 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-04-06 17:24:46 -0700 |
| commit | e3099b458b5c11742c1b88c27847801090870f2d (patch) | |
| tree | 7058cb1bfa4cd9ba53edcf9f5f231e9debb7c11d /scripts | |
| parent | 0c0f68939e0d8367e55793f80f0000f2a43a812a (diff) | |
| download | vcpkg-e3099b458b5c11742c1b88c27847801090870f2d.tar.gz vcpkg-e3099b458b5c11742c1b88c27847801090870f2d.zip | |
Use 7zip920 instead of 7zr
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 19 | ||||
| -rw-r--r-- | scripts/fetchTool.ps1 | 14 | ||||
| -rw-r--r-- | scripts/vcpkgTools.xml | 11 |
3 files changed, 34 insertions, 10 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 7082ca747..d7967889e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -198,6 +198,25 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$sevenZipExe, Rename-Item -Path "$destinationPartial" -NewName $destinationDir } +function vcpkgExtractZipFileWithShell( [Parameter(Mandatory=$true)][string]$archivePath, + [Parameter(Mandatory=$true)][string]$destinationDir) +{ + vcpkgRemoveItem $destinationDir + $destinationPartial = "$destinationDir.partial" + vcpkgRemoveItem $destinationPartial + vcpkgCreateDirectoryIfNotExists $destinationPartial + + $shell = new-object -com shell.application + $zip = $shell.NameSpace($(Get-Item $archivePath).fullname) + foreach($item in $zip.items()) + { + # Piping to Out-Null is used to block until finished + $shell.Namespace($destinationPartial).copyhere($item) | Out-Null + } + + Rename-Item -Path "$destinationPartial" -NewName $destinationDir +} + function vcpkgInvokeCommand() { param ( [Parameter(Mandatory=$true)][string]$executable, diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 05335c724..e46c7808d 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -48,8 +48,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) { Write-Host "Downloading $tool..." - # aria2 needs 7zip & 7zr to extract. So, we need to download those trough powershell - if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zr") + # aria2 needs 7zip & 7zip920 to extract. So, we need to download those trough powershell + if ($tool -eq "aria2" -or $tool -eq "7zip" -or $tool -eq "7zip920") { vcpkgDownloadFile $url $downloadPath } @@ -69,10 +69,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) if ($isArchive) { Write-Host "Extracting $tool..." - if ($tool -eq "7zip") + if ($tool -eq "7zip920") { - $sevenZipR = fetchToolInternal "7zr" - $ec = vcpkgInvokeCommand "$sevenZipR" "x `"$downloadPath`" -o`"$toolPath`" -y" + vcpkgExtractZipFileWithShell -ArchivePath $downloadPath -DestinationDir $toolPath + } + elseif ($tool -eq "7zip") + { + $sevenZip920 = fetchToolInternal "7zip920" + $ec = vcpkgInvokeCommand "$sevenZip920" "x `"$downloadPath`" -o`"$toolPath`" -y" if ($ec -ne 0) { Write-Host "Could not extract $downloadPath" diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index fe1cc12a9..810818998 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -54,11 +54,12 @@ <sha256>9371df22bcd0e1aff9eaa52aa3292350eecd011f11494e709314ae3f3eb279e2</sha256> <archiveRelativePath>7z1801-extra.7z</archiveRelativePath> </tool> - <tool name="7zr"> - <requiredVersion>18.01.0</requiredVersion> - <exeRelativePath>7zr.exe</exeRelativePath> - <url>https://www.7-zip.org/a/7zr.exe</url> - <sha256>2c7a8709260e0295a2a3cfd5a8ad0459f37490ed1794ea68bf85a6fab362553b</sha256> + <tool name="7zip920"> + <requiredVersion>9.20.0</requiredVersion> + <exeRelativePath>7za.exe</exeRelativePath> + <url>https://www.7-zip.org/a/7za920.zip</url> + <sha256>2a3afe19c180f8373fa02ff00254d5394fec0349f5804e0ad2f6067854ff28ac</sha256> + <archiveRelativePath>7za920.zip</archiveRelativePath> </tool> <tool name="aria2"> <requiredVersion>18.01.0</requiredVersion> |
