Browse Source

getzig.ps1 change zip extraction method from Expand-Archive to System.IO.Compression.Zipfile

master
Julian Noble 2 weeks ago
parent
commit
f9c228383f
  1. 14
      bin/getzig.cmd
  2. 14
      src/scriptapps/getzig.ps1

14
bin/getzig.cmd

@ -895,7 +895,12 @@ if (Get-Command "minisign" -ErrorAction SilentlyContinue) {
if ($wingetversion) {
Write-Host "Installing minisign version: ${wingetversion}"
Install-WinGetPackage -Id "jedisct1.minisign"
} else {
Write-Host "Failed to find minisign using winget"
exit
}
#refreshing the current session's path should make the new command available (required for powershell 5 at least)
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
if (Get-Command "minisign" -ErrorAction SilentlyContinue) {
Write-Host "minisign is now available"
} else {
@ -1046,8 +1051,13 @@ if ($mirrors_response.StatusCode -eq 200) {
continue
}
Write-Host "Signature OK - extracting archive"
Expand-Archive -path $outfile -DestinationPath $toolsfolder -Force
Write-Host "Signature OK - extracting archive ..."
#Expand-Archive -path $outfile -DestinationPath $toolsfolder -Force #This is *insanely* (many minutes vs seconds) slow on powershell 5 at least - we get a progress meter, but it's too high a price to pay.
Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.Zipfile]::ExtractToDirectory($releasearchive,$toolsfolder)
Write-Host " - archive extracted."
#Remove-Item -Path "$outfile"
$zip_rootname = [System.IO.Path]::GetFileNameWithoutExtension($releasearchive)
#Rename-Item -Path

14
src/scriptapps/getzig.ps1

@ -61,7 +61,12 @@ if (Get-Command "minisign" -ErrorAction SilentlyContinue) {
if ($wingetversion) {
Write-Host "Installing minisign version: ${wingetversion}"
Install-WinGetPackage -Id "jedisct1.minisign"
} else {
Write-Host "Failed to find minisign using winget"
exit
}
#refreshing the current session's path should make the new command available (required for powershell 5 at least)
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
if (Get-Command "minisign" -ErrorAction SilentlyContinue) {
Write-Host "minisign is now available"
} else {
@ -212,8 +217,13 @@ if ($mirrors_response.StatusCode -eq 200) {
continue
}
Write-Host "Signature OK - extracting archive"
Expand-Archive -path $outfile -DestinationPath $toolsfolder -Force
Write-Host "Signature OK - extracting archive ..."
#Expand-Archive -path $outfile -DestinationPath $toolsfolder -Force #This is *insanely* (many minutes vs seconds) slow on powershell 5 at least - we get a progress meter, but it's too high a price to pay.
Add-Type -Assembly "System.IO.Compression.Filesystem"
[System.IO.Compression.Zipfile]::ExtractToDirectory($releasearchive,$toolsfolder)
Write-Host " - archive extracted."
#Remove-Item -Path "$outfile"
$zip_rootname = [System.IO.Path]::GetFileNameWithoutExtension($releasearchive)
#Rename-Item -Path

Loading…
Cancel
Save