diff --git a/bin/getzig.cmd b/bin/getzig.cmd index dfb00908..8049b6bc 100644 --- a/bin/getzig.cmd +++ b/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 diff --git a/src/scriptapps/getzig.ps1 b/src/scriptapps/getzig.ps1 index 26d508ea..f4a861ff 100644 --- a/src/scriptapps/getzig.ps1 +++ b/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