fix SHA256 verification of .zip and hash contents of .zip.sha256

This commit is contained in:
Jessie Broke 2024-09-27 18:43:11 -04:00
parent f30af0923d
commit 58e3ecdccc
1 changed files with 6 additions and 3 deletions

View File

@ -37,10 +37,13 @@ for %%B in (%BINARY_NAMES%) do (
for /f "tokens=1" %%a in (!FILE_NAME!.sha256) do set "EXPECTED_SHA256=%%a"
for /f "tokens=* usebackq" %%a in (`powershell -Command "& {Get-FileHash '!FILE_NAME!' -Algorithm SHA256 | Select-Object -ExpandProperty Hash}"`) do set "ACTUAL_SHA256=%%a"
if not "!ACTUAL_SHA256!"=="!EXPECTED_SHA256!" (
echo Checksum verification failed for !FILE_NAME!. Expected: !EXPECTED_SHA256!, Got: !ACTUAL_SHA256!
if /I not "!ACTUAL_SHA256!"=="!EXPECTED_SHA256!" (
echo Checksum verification failed for !FILE_NAME!.
echo Expected: !EXPECTED_SHA256!
echo Got: !ACTUAL_SHA256!
exit /b 1
)
echo Checksum verification successful for !FILE_NAME!.
echo Extracting !FILE_NAME!...
powershell -Command "& {Expand-Archive -Path '!FILE_NAME!' -DestinationPath '!EXTRACT_DIR!' -Force}"