mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 21:58:06 -05:00
remove md5 check for windows update script as content-md5 header no longer appears to be transmitted
This commit is contained in:
parent
40655025fc
commit
8f60a37321
@ -61,8 +61,6 @@ if ($fileDownload.StatusDescription -ne "OK")
|
|||||||
throw "Could not update IW4MAdmin. ($fileDownload.StatusDescription)"
|
throw "Could not update IW4MAdmin. ($fileDownload.StatusDescription)"
|
||||||
}
|
}
|
||||||
|
|
||||||
$remoteHash = $fileDownload.Headers['Content-MD5']
|
|
||||||
$decodedHash = [System.BitConverter]::ToString([System.Convert]::FromBase64String($remoteHash)).replace('-', '')
|
|
||||||
$directoryPath = Get-Location
|
$directoryPath = Get-Location
|
||||||
$fullPath = "$directoryPath\$filename"
|
$fullPath = "$directoryPath\$filename"
|
||||||
$outputFile = [System.IO.File]::Open($fullPath, 2)
|
$outputFile = [System.IO.File]::Open($fullPath, 2)
|
||||||
@ -88,13 +86,6 @@ finally
|
|||||||
$outputFile.Dispose()
|
$outputFile.Dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
$localHash = (Get-FileHash -Path $fullPath -Algorithm MD5).Hash
|
|
||||||
|
|
||||||
if ($localHash -ne $decodedHash)
|
|
||||||
{
|
|
||||||
throw "Failed to update. File hashes don't match!"
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Output "Extracting $filename to $outputDir"
|
Write-Output "Extracting $filename to $outputDir"
|
||||||
Expand-Archive -Path $fullPath -DestinationPath $outputDir -Force
|
Expand-Archive -Path $fullPath -DestinationPath $outputDir -Force
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user