[Windows] Update helper name to Expand-7ZipArchive (#8875)

* [Windows] Update helper name to Expand-7ZipArchive

* Fix typo
This commit is contained in:
Vasilii Polikarpov
2023-11-23 11:59:49 +01:00
committed by GitHub
parent 64d5d2c1f4
commit 6efbc46fc7
20 changed files with 28 additions and 28 deletions

View File

@@ -14,6 +14,6 @@ Write-Host "Download Latest action-versions archive from $downloadUrl"
$actionVersionsArchivePath = Start-DownloadWithRetry -Url $downloadUrl -Name "action-versions.zip"
Write-Host "Expand action-versions archive"
Extract-7Zip -Path $actionVersionsArchivePath -DestinationPath $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
Expand-7ZipArchive -Path $actionVersionsArchivePath -DestinationPath $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
Invoke-PesterTests -TestFile "ActionArchiveCache"

View File

@@ -21,7 +21,7 @@ Use-ChecksumComparison $fileHash $externalHash
Write-Host "Expand aliyun-cli archive"
$aliyunPath = "C:\aliyun-cli"
New-Item -Path $aliyunPath -ItemType Directory -Force
Extract-7Zip -Path $packagePath -DestinationPath $aliyunPath
Expand-7ZipArchive -Path $packagePath -DestinationPath $aliyunPath
# Add aliyun-cli to path
Add-MachinePathItem $aliyunPath

View File

@@ -19,7 +19,7 @@ Use-ChecksumComparison -LocalFileHash $localFileHash -DistributorFileHash $andro
$sdkInstallRoot = "C:\Program Files (x86)\Android\android-sdk"
$sdkRoot = "C:\Android\android-sdk"
Extract-7Zip -Path $cmdlineToolsArchPath -DestinationPath "${sdkInstallRoot}\cmdline-tools"
Expand-7ZipArchive -Path $cmdlineToolsArchPath -DestinationPath "${sdkInstallRoot}\cmdline-tools"
# cmdline tools should be installed in ${sdkInstallRoot}\cmdline-tools\latest\bin, but archive contains ${sdkInstallRoot}\cmdline-tools\bin
# we need to create the proper folder structure
@@ -46,7 +46,7 @@ $sdkManager = "$sdkRoot\cmdline-tools\latest\bin\sdkmanager.bat"
$licenseContentBase64 = "UEsDBBQAAAAAAKNK11IAAAAAAAAAAA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2lkLXN5c2ltYWdlLWxpY2Vuc2UKACAAAAAAAAEAGAA4LjgXEWjXATguOBcRaNcBIgc4FxFo1wFQSwUGAAAAAAgACACDAwAACQMAAAAA"
$licenseContent = [System.Convert]::FromBase64String($licenseContentBase64)
Set-Content -Path "$sdkInstallRoot\android-sdk-licenses.zip" -Value $licenseContent -Encoding Byte
Extract-7Zip -Path "$sdkInstallRoot\android-sdk-licenses.zip" -DestinationPath $sdkInstallRoot
Expand-7ZipArchive -Path "$sdkInstallRoot\android-sdk-licenses.zip" -DestinationPath $sdkInstallRoot
# install platform-tools
$platformToolsPath = Join-Path -Path $sdkInstallRoot -ChildPath "platform-tools"

View File

@@ -13,7 +13,7 @@ $setupPath = Join-Path $env:TEMP "BizTalkBuildComponent"
if (-not (Test-Path -Path $setupPath)) {
$null = New-Item -Path $setupPath -ItemType Directory -Force
}
Extract-7Zip -Path $setupZipFile -DestinationPath $setupPath
Expand-7ZipArchive -Path $setupZipFile -DestinationPath $setupPath
Write-Host "Installing BizTalk Project Build Component..."
Install-Binary `

View File

@@ -74,7 +74,7 @@ Write-Host "Download Chrome WebDriver from $ChromeDriverZipDownloadUrl..."
$ChromeDriverArchPath = Start-DownloadWithRetry -Url $ChromeDriverZipDownloadUrl
Write-Host "Expand Chrome WebDriver archive (without using directory names)..."
Extract-7Zip -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath -ExtractMethod "e"
Expand-7ZipArchive -Path $ChromeDriverArchPath -DestinationPath $ChromeDriverPath -ExtractMethod "e"
Write-Host "Setting the environment variables..."
[Environment]::SetEnvironmentVariable("ChromeWebDriver", $ChromeDriverPath, "Machine")

View File

@@ -15,7 +15,7 @@ New-Item -Path $CloudFoundryCliPath -ItemType Directory -Force
# Extract the zip archive
Write-Host "Extracting cf cli..."
Extract-7Zip -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath
Expand-7ZipArchive -Path $CloudFoundryArchPath -DestinationPath $CloudFoundryCliPath
# Add cf to path
Add-MachinePathItem $CloudFoundryCliPath

View File

@@ -18,9 +18,9 @@ $CodeQLToolcachePath = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" |
New-Item -Path $CodeQLToolcachePath -ItemType Directory -Force | Out-Null
Write-Host "Unpacking the downloaded CodeQL bundle archive..."
Extract-7Zip -Path $CodeQLBundlePath -DestinationPath $DownloadDirectoryPath
Expand-7ZipArchive -Path $CodeQLBundlePath -DestinationPath $DownloadDirectoryPath
$UnGzipedCodeQLBundlePath = Join-Path $DownloadDirectoryPath "codeql-bundle.tar"
Extract-7Zip -Path $UnGzipedCodeQLBundlePath -DestinationPath $CodeQLToolcachePath
Expand-7ZipArchive -Path $UnGzipedCodeQLBundlePath -DestinationPath $CodeQLToolcachePath
Write-Host "CodeQL bundle at $($CodeQLToolcachePath) contains the following directories:"
Get-ChildItem -Path $CodeQLToolcachePath -Depth 2

View File

@@ -31,7 +31,7 @@ $EdgeDriverDownloadUrl = "https://msedgedriver.azureedge.net/${EdgeDriverLatestV
$EdgeDriverArchPath = Start-DownloadWithRetry -Url $EdgeDriverDownloadUrl -Name $EdgeDriverArchName
Write-Host "Expand Microsoft Edge WebDriver archive..."
Extract-7Zip -Path $EdgeDriverArchPath -DestinationPath $EdgeDriverPath
Expand-7ZipArchive -Path $EdgeDriverArchPath -DestinationPath $EdgeDriverPath
#Validate the EdgeDriver signature
$EdgeDriverSignatureThumbprint = "CB9C4FBEA1D87D2D468AC5A9CAAB0163F6AD8401"

View File

@@ -48,7 +48,7 @@ $GeckoDriverDownloadUrl = $GeckoDriverWindowsAsset.browser_download_url
$GeckoDriverArchPath = Start-DownloadWithRetry -Url $GeckoDriverDownloadUrl -Name $GeckoDriverArchName
Write-Host "Expand Gecko WebDriver archive..."
Extract-7Zip -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath
Expand-7ZipArchive -Path $GeckoDriverArchPath -DestinationPath $GeckoDriverPath
# Validate Gecko WebDriver signature
$GeckoDriverSignatureThumbprint = "1326B39C3D5D2CA012F66FB439026F7B59CB1974"

View File

@@ -26,7 +26,7 @@ if (-not (Test-Path -Path $ieDriverPath)) {
$null = New-Item -Path $ieDriverPath -ItemType Directory -Force
}
Extract-7Zip -Path $driverZipFile -DestinationPath $ieDriverPath
Expand-7ZipArchive -Path $driverZipFile -DestinationPath $ieDriverPath
Remove-Item $driverZipFile
Write-Host "Get the IEDriver version..."

View File

@@ -89,7 +89,7 @@ function Install-JavaJDK {
New-Item -ItemType Directory -Path $javaVersionPath -Force | Out-Null
# Complete the installation by extracting Java binaries to toolcache and creating the complete file
Extract-7Zip -Path $archivePath -DestinationPath $javaVersionPath
Expand-7ZipArchive -Path $archivePath -DestinationPath $javaVersionPath
Invoke-SBWithRetry -Command {
Get-ChildItem -Path $javaVersionPath | Rename-Item -NewName $javaArchPath -ErrorAction Stop
}
@@ -141,7 +141,7 @@ $coberturaPath = "C:\cobertura-2.1.1"
$archivePath = Start-DownloadWithRetry -Url $uri -Name "cobertura.zip"
$fileHash = (Get-FileHash -Path $archivePath -Algorithm SHA256).Hash
Use-ChecksumComparison $fileHash $sha256sum
Extract-7Zip -Path $archivePath -DestinationPath "C:\"
Expand-7ZipArchive -Path $archivePath -DestinationPath "C:\"
[Environment]::SetEnvironmentVariable("COBERTURA_HOME", $coberturaPath, "Machine")

View File

@@ -19,7 +19,7 @@ Use-ChecksumComparison $fileHash $externalHash
Write-Host "Expand Kotlin archive"
$kotlinPath = "C:\tools"
Extract-7Zip -Path $kotlinInstallerPath -DestinationPath $kotlinPath
Expand-7ZipArchive -Path $kotlinInstallerPath -DestinationPath $kotlinPath
# Add to PATH
Add-MachinePathItem "$kotlinPath\kotlinc\bin"

View File

@@ -23,7 +23,7 @@ if (Test-IsWin19) {
if ($hash.Hash -ne $sha256sum) {
throw "Checksum verification failed for $packagePath"
}
Extract-7Zip -Path $packagePath -DestinationPath "C:\"
Expand-7ZipArchive -Path $packagePath -DestinationPath "C:\"
# Make a copy of mingw-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux
@@ -58,7 +58,7 @@ if (Test-IsWin19) {
-UrlFilter "*$arch-{Version}-release-$threads-$exceptions-$runtime-*.7z"
$packagePath = Start-DownloadWithRetry -Url $url -Name "$_.7z"
Extract-7Zip -Path $packagePath -DestinationPath "C:\"
Expand-7ZipArchive -Path $packagePath -DestinationPath "C:\"
# Make a copy of mingw-make.exe to make.exe, which is a more discoverable name
# and so the same command line can be used on Windows as on macOS and Linux

View File

@@ -21,7 +21,7 @@ function Install-PyPy
# Expand archive with binaries
$packageName = [IO.Path]::GetFileNameWithoutExtension((Split-Path -Path $packagePath -Leaf))
$tempFolder = Join-Path -Path $pypyToolcachePath -ChildPath $packageName
Extract-7Zip -Path $packagePath -DestinationPath $pypyToolcachePath
Expand-7ZipArchive -Path $packagePath -DestinationPath $pypyToolcachePath
# Get Python version from binaries
$pypyApp = Get-ChildItem -Path "$tempFolder\pypy*.exe" | Where-Object Name -match "pypy(\d+)?.exe" | Select-Object -First 1

View File

@@ -48,7 +48,7 @@ function Install-Ruby {
# Expand archive with binaries
$packageName = [IO.Path]::GetFileNameWithoutExtension((Split-Path -Path $PackagePath -Leaf))
$tempFolder = Join-Path -Path $rubyToolcachePath -ChildPath $packageName
Extract-7Zip -Path $PackagePath -DestinationPath $rubyToolcachePath
Expand-7ZipArchive -Path $PackagePath -DestinationPath $rubyToolcachePath
# Get Ruby version from binaries
$rubyVersion = & "$tempFolder\bin\ruby.exe" -e "print RUBY_VERSION"

View File

@@ -23,7 +23,7 @@ Use-ChecksumComparison $fileHash $externalHash
#endregion
Write-Host "Expand stack archive"
Extract-7Zip -Path $StackArchivePath -DestinationPath $DestinationPath
Expand-7ZipArchive -Path $StackArchivePath -DestinationPath $DestinationPath
New-Item -Name "x64.complete" -Path $StackToolcachePath

View File

@@ -19,10 +19,10 @@ Function Install-Asset {
Write-Host "Extract $($ReleaseAsset.filename) content..."
if ($assetArchivePath.EndsWith(".tar.gz")) {
$assetTarPath = $assetArchivePath.TrimEnd(".tar.gz")
Extract-7Zip -Path $assetArchivePath -DestinationPath $assetTarPath
Extract-7Zip -Path $assetTarPath -DestinationPath $assetFolderPath
Expand-7ZipArchive -Path $assetArchivePath -DestinationPath $assetTarPath
Expand-7ZipArchive -Path $assetTarPath -DestinationPath $assetFolderPath
} else {
Extract-7Zip -Path $assetArchivePath -DestinationPath $assetFolderPath
Expand-7ZipArchive -Path $assetArchivePath -DestinationPath $assetFolderPath
}
Write-Host "Invoke installation script..."
@@ -55,4 +55,4 @@ foreach ($tool in $tools) {
exit 1
}
}
}
}

View File

@@ -14,12 +14,12 @@ $zstdParentName = [IO.Path]::GetFileNameWithoutExtension($zstdLatest)
$filesInArchive = 7z l $zstdArchivePath | Out-String
if ($filesInArchive.Contains($zstdParentName)) {
Extract-7Zip -Path $zstdArchivePath -DestinationPath $toolPath
Expand-7ZipArchive -Path $zstdArchivePath -DestinationPath $toolPath
Invoke-SBWithRetry -Command {
Move-Item -Path "${zstdPath}*" -Destination $zstdPath -ErrorAction Stop
}
} else {
Extract-7Zip -Path $zstdArchivePath -DestinationPath $zstdPath
Expand-7ZipArchive -Path $zstdArchivePath -DestinationPath $zstdPath
}
# Add zstd-win64 to PATH

View File

@@ -39,7 +39,7 @@ Export-ModuleMember -Function @(
'Send-RequestToCocolateyPackages'
'Resolve-ChocoPackageVersion'
'Get-GitHubPackageDownloadUrl'
'Extract-7Zip'
'Expand-7ZipArchive'
'Invoke-SBWithRetry'
'Get-VsCatalogJsonPath'
'Install-AndroidSDKPackages'

View File

@@ -489,7 +489,7 @@ function Test-IsWin19
(Get-WinVersion) -match "2019"
}
function Extract-7Zip {
function Expand-7ZipArchive {
Param
(
[Parameter(Mandatory=$true)]