[Windows] Implement new directories hierarchy (#8616)

This commit is contained in:
Vasilii Polikarpov
2023-11-15 11:24:45 +01:00
committed by GitHub
parent 84a7deae24
commit d1f2c9a3be
165 changed files with 1146 additions and 1139 deletions

View File

@@ -0,0 +1,28 @@
################################################################################
## File: Install-zstd.ps1
## Desc: Install zstd
################################################################################
$url = "https://api.github.com/repos/facebook/zstd/releases/latest"
# Explicitly set type to string since match returns array by default
[System.String] $zstdLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "zstd-.+-win64.zip$"
$zstdArchivePath = Start-DownloadWithRetry -Url $zstdLatest -Name "zstd-win64.zip"
$toolPath = "C:\tools"
$zstdPath = Join-Path $toolPath zstd
$zstdParentName = [IO.Path]::GetFileNameWithoutExtension($zstdLatest)
$filesInArchive = 7z l $zstdArchivePath | Out-String
if ($filesInArchive.Contains($zstdParentName)) {
Extract-7Zip -Path $zstdArchivePath -DestinationPath $toolPath
Invoke-SBWithRetry -Command {
Move-Item -Path "${zstdPath}*" -Destination $zstdPath -ErrorAction Stop
}
} else {
Extract-7Zip -Path $zstdArchivePath -DestinationPath $zstdPath
}
# Add zstd-win64 to PATH
Add-MachinePathItem $zstdPath
Invoke-PesterTests -TestFile "Tools" -TestName "Zstd"