Skip to content

Commit

Permalink
WindowsPB: Include Checksum Verification of VS2019 Layout (#3175)
Browse files Browse the repository at this point in the history
* Add VS2022 installation

* Add checksum verification

Add checksum verification for VS2019 layout

* Revert "Add VS2022 installation"

This reverts commit d30f51d.

* Update main.yml

Correct checksum
  • Loading branch information
steelhead31 authored Sep 5, 2023
1 parent 894eedf commit f081d33
Showing 1 changed file with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
register: vs2019_layout_ready
tags: adoptopenjdk

- name: Get SHA256 checksum of the file
win_shell: |
$filePath = "C:\TEMP\VS2019_Layout.zip"
$expectedChecksum = "C73A5F3C8A8AB50BC971551FA626438FEA89E0ED71F77EE570094E0C394C419E"
$actualChecksum = Get-FileHash -Path $filePath -Algorithm SHA256 | Select-Object -ExpandProperty Hash
if ($actualChecksum -ne $expectedChecksum) {
Write-Output "Checksum mismatch"
Write-Output "Actual Checksum: $actualChecksum"
Write-Output "Expect Checksum: $expectedChecksum"
exit 1
}
register: checksum_result
changed_when: false
tags: adoptopenjdk

# Exit Play If No VS2019 Layout & AdoptOpenJDK = true
# This Is Defined Behaviour - This Shouldnt Occur But If It Does, Its Captured Here
- name: Exit With Error When No Layout Within AdoptOpenJDK
Expand All @@ -49,12 +65,17 @@
when: (vs2019_layout_ready.stat.exists) and (not vs2019_installed.stat.exists)
tags: adoptopenjdk

- name: Remove Visual Studio 2019 Layout Files
- name: Remove VS2019 Zip File
win_file:
path: "{{ items }}"
with_items:
- 'C:\TEMP\VS2019_Layout.zip'
- 'C:\temp\VSLayout2019'
path: C:\TEMP\VS2019_Layout.zip
state: absent
when: (not vs2019_installed.stat.exists)
tags: adoptopenjdk

- name: Remove VS2019 Unzipped Layout
win_file:
path: C:\temp\VSLayout2019
state: absent
when: (not vs2019_installed.stat.exists)
tags: adoptopenjdk

Expand Down

0 comments on commit f081d33

Please sign in to comment.