|
494 | 494 | $CefWin64CefVersion = $CefBuildsJson.windows64.versions | Where-Object {$_.cef_version -eq $CefVersion} |
495 | 495 |
|
496 | 496 | $Cef32FileName = ($CefWin32CefVersion.files | Where-Object {$_.type -eq "standard"}).name |
| 497 | + $Cef32FileHash = ($CefWin32CefVersion.files | Where-Object {$_.type -eq "standard"}).sha1 |
| 498 | + $Cef32FileSize = (($CefWin32CefVersion.files | Where-Object {$_.type -eq "standard"}).size /1MB) |
497 | 499 | $Cef64FileName = ($CefWin64CefVersion.files | Where-Object {$_.type -eq "standard"}).name |
| 500 | + $Cef64FileHash = ($CefWin64CefVersion.files | Where-Object {$_.type -eq "standard"}).sha1 |
| 501 | + $Cef64FileSize = (($CefWin64CefVersion.files | Where-Object {$_.type -eq "standard"}).size /1MB) |
498 | 502 |
|
499 | 503 | # Make sure there is a 32bit and 64bit version for the specified build |
500 | 504 | if ($CefWin32CefVersion.cef_version -ne $CefWin64CefVersion.cef_version) |
|
508 | 512 |
|
509 | 513 | if (-not (Test-Path $LocalFile)) |
510 | 514 | { |
511 | | - Write-Diagnostic "Downloading $Cef32FileName; this will take a while as the file is approximately 200 MiB large." |
| 515 | + Write-Diagnostic "Downloading $Cef32FileName; this will take a while as the file is $Cef32FileSize MB." |
512 | 516 | $Client.DownloadFile($CefBuildServerUrl + $Cef32FileName, $LocalFile); |
| 517 | + |
| 518 | + $Cef32LocalFileHash = Get-FileHash -Path $LocalFile -Algorithm SHA1 |
| 519 | + |
513 | 520 | Write-Diagnostic "Download $Cef32FileName complete" |
| 521 | + Write-Diagnostic "Expected SHA1 for $Cef32FileName $Cef32FileHash" |
| 522 | + Write-Diagnostic "Actual SHA1 for $Cef32FileName $Cef32LocalFileHash" |
| 523 | + |
| 524 | + if($Cef32LocalFileHash -ne $Cef32FileHash) |
| 525 | + { |
| 526 | + Die "SHA1 hash did not match" |
| 527 | + } |
514 | 528 | } |
515 | 529 |
|
516 | 530 | if (-not (Test-Path (Join-Path $Cef32 '\include\cef_version.h'))) |
|
537 | 551 |
|
538 | 552 | if (-not (Test-Path $LocalFile)) |
539 | 553 | { |
540 | | - Write-Diagnostic "Downloading $Cef64FileName; this will take a while as the file is approximately 200 MiB large." |
| 554 | + Write-Diagnostic "Downloading $Cef64FileName; this will take a while as the file is $Cef64FileSize MB." |
541 | 555 | $Client.DownloadFile($CefBuildServerUrl + $Cef64FileName, $LocalFile); |
| 556 | + |
| 557 | + $Cef32LocalFileHash = Get-FileHash -Path $LocalFile -Algorithm SHA1 |
| 558 | + |
542 | 559 | Write-Diagnostic "Download $Cef64FileName complete" |
| 560 | + Write-Diagnostic "Expected SHA1 for $Cef64FileName $Cef64FileHash" |
| 561 | + Write-Diagnostic "Actual SHA1 for $Cef64FileName $Cef64LocalFileHash" |
| 562 | + |
| 563 | + if($Cef64LocalFileHash -ne $Cef64FileHash) |
| 564 | + { |
| 565 | + Die "SHA1 hash did not match" |
| 566 | + } |
543 | 567 | } |
544 | 568 |
|
545 | 569 | if (-not (Test-Path (Join-Path $Cef64 '\include\cef_version.h'))) |
|
0 commit comments