|
10 | 10 |
|
11 | 11 | - name: Test if VS 2022 is installed
|
12 | 12 | win_stat:
|
13 |
| - path: 'C:\Program Files\Microsoft Visual Studio\2022' |
| 13 | + path: 'C:\Program Files (x86)\Microsoft Visual Studio\2022' |
14 | 14 | register: vs2022_installed
|
15 | 15 | tags: adoptopenjdk
|
16 | 16 |
|
17 |
| -- name: Install VS2022 |
| 17 | +# Update MSVS 2022 Installation For JDK25 ZGC Errors |
| 18 | +# https://github.com/adoptium/infrastructure/issues/4064 |
| 19 | +# https://github.com/adoptium/aqa-tests/issues/6592 |
| 20 | +- name: Install VS2022 From Adoptium Layout |
18 | 21 | when: (not vs2022_installed.stat.exists) and (windows_version.stdout_lines[0] | regex_search('^(10\.|11\.|2016|2019|2022)'))
|
19 | 22 | tags: adoptopenjdk
|
20 | 23 | block:
|
21 | 24 | - name: Transfer VS2022 Layout File
|
22 | 25 | win_copy:
|
23 |
| - src: /Vendor_Files/windows/vs_layout_2022.zip |
| 26 | + src: /Vendor_Files/windows/vs_layout_2022_17092025.zip |
24 | 27 | dest: C:\TEMP\VS2022_Layout.zip
|
25 | 28 | remote_src: no
|
26 | 29 | failed_when: false
|
|
34 | 37 | - name: Get SHA256 checksum of the file
|
35 | 38 | win_shell: |
|
36 | 39 | $filePath = "C:\TEMP\VS2022_Layout.zip"
|
37 |
| - $expectedChecksum = "29567E33B5361E4BAD36DFDFF83FEB3DDFDF0518122237E8273F0FA4E11E8B74" |
| 40 | + $expectedChecksum = "C22C8E30E5D6EB84EC0C226E5459507BD5B015A1CC075AD324C2B66BB63B5B74" |
38 | 41 | $actualChecksum = Get-FileHash -Path $filePath -Algorithm SHA256 | Select-Object -ExpandProperty Hash
|
39 | 42 |
|
40 | 43 | if ($actualChecksum -ne $expectedChecksum) {
|
|
62 | 65 | when: (vs2022_layout_ready.stat.exists)
|
63 | 66 |
|
64 | 67 | # When Installing From The Layout, We Need To Ensure the x86 installer is not detected.
|
| 68 | + - name: Check if x86 Installer folder exists |
| 69 | + win_stat: |
| 70 | + path: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer" |
| 71 | + register: vs2022_installer_folder |
| 72 | + when: (vs2022_layout_ready.stat.exists) |
| 73 | + |
65 | 74 | - name: Rename x86 Installer When Installing VS2022 from the Adoptium Layout
|
66 | 75 | win_shell: |
|
67 | 76 | Rename-Item -Path "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer" -NewName "Installer.old"
|
68 | 77 | args:
|
69 | 78 | executable: powershell
|
70 | 79 | creates: "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer.old"
|
71 |
| - when: (vs2022_layout_ready.stat.exists) |
| 80 | + when: |
| 81 | + - vs2022_layout_ready.stat.exists |
| 82 | + - vs2022_installer_folder.stat.exists |
72 | 83 |
|
73 | 84 | - name: Run Visual Studio 2022 Installer From Layout
|
74 | 85 | win_shell: |
|
75 |
| - Start-Process -Wait -FilePath 'C:\temp\VSLayout2022\vs_community.exe' -ArgumentList '--nocache --quiet --norestart --wait --noweb --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64' |
| 86 | + Start-Process -Wait -FilePath 'C:\temp\VSLayout2022\vs_setup.exe' -ArgumentList '--nocache --quiet --norestart --wait --noweb --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64' |
76 | 87 | args:
|
77 | 88 | executable: powershell
|
78 | 89 | when: (vs2022_layout_ready.stat.exists)
|
79 | 90 |
|
80 | 91 | - name: Register Visual Studio Community 2022 DIA SDK shared libraries
|
81 | 92 | win_command: 'regsvr32 /s "{{ item }}"'
|
82 | 93 | with_items:
|
83 |
| - - C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\msdia140.dll |
84 |
| - - C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\amd64\msdia140.dll |
| 94 | + - C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\DIA SDK\bin\msdia140.dll |
| 95 | + - C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\DIA SDK\bin\amd64\msdia140.dll |
85 | 96 |
|
86 | 97 | - name: Remove VS2022 Zip File
|
87 | 98 | win_file:
|
|
95 | 106 |
|
96 | 107 | - name: Test if VS 2022 is installed(non adopt)
|
97 | 108 | win_stat:
|
98 |
| - path: 'C:\Program Files\Microsoft Visual Studio\2022' |
| 109 | + path: 'C:\Program Files (x86)\Microsoft Visual Studio\2022' |
99 | 110 | register: vs2022_installed
|
100 | 111 |
|
101 | 112 | # Download & Install VS2022 When No Layout & Not AdoptOpenJDK
|
102 |
| -# This is the target that you're redirected to when you go to https://aka.ms/vs/17/release/vs_community.exe |
103 |
| -- name: Download Visual Studio Community 2022 |
| 113 | +# This is the download to install the same payloads as the adoptium layout above |
| 114 | +- name: Download VS Build Tools install for 17.12.12 |
104 | 115 | win_get_url:
|
105 |
| -# https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history |
106 |
| -# 17.7.34302.85 url: 'https://download.visualstudio.microsoft.com/download/pr/47b236ad-5505-4752-9d2b-5cf9795528bc/87684889f46dec53d1452f4a0ff9fec1ac202a97ebed866718d7c0269e814b28/vs_BuildTools.exe' |
107 |
| - url: 'https://download.visualstudio.microsoft.com/download/pr/1d66edfe-3c83-476b-bf05-e8901c62ba7f/bac71effb5a23d7cd1a81e5f628a0c8dcb7e8a07e0aa7077c853ed84a862dceb/vs_BuildTools.exe' # 17.7.3 = 17.7.34024.191 |
108 |
| - checksum: bac71effb5a23d7cd1a81e5f628a0c8dcb7e8a07e0aa7077c853ed84a862dceb |
| 116 | + url: 'https://download.visualstudio.microsoft.com/download/pr/8eb6bd5d-4ec9-4328-a0e7-f59e7e51fdca/9b748c66ba6a2b22f346cc113f354ded3b202b53a109fff93111167741acb6c1/vs_BuildTools.exe' # 17.12.12 |
| 117 | + checksum: 9b748c66ba6a2b22f346cc113f354ded3b202b53a109fff93111167741acb6c1 |
109 | 118 | checksum_algorithm: sha256
|
110 | 119 | dest: 'C:\temp\vs_BuildTools22.exe'
|
111 | 120 | force: no
|
112 | 121 | when: (not vs2022_installed.stat.exists) and (windows_version.stdout_lines[0] | regex_search('^(10\.|11\.|2016|2019|2022)'))
|
113 | 122 |
|
114 | 123 | - name: Run Visual Studio 2022 Installer From Download
|
115 | 124 | win_shell: |
|
116 |
| - Start-Process -Wait -FilePath 'C:\temp\vs_BuildTools22.exe' -ArgumentList '--wait --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --includeRecommended --includeOptional --quiet --norestart' |
| 125 | + Start-Process -Wait -FilePath 'C:\temp\vs_BuildTools22.exe' -ArgumentList '--wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --quiet --norestart' |
117 | 126 | args:
|
118 | 127 | executable: powershell
|
119 | 128 | when: (not vs2022_installed.stat.exists) and (windows_version.stdout_lines[0] | regex_search('^(10\.|11\.|2016|2019|2022)'))
|
|
128 | 137 | - C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\DIA SDK\bin\amd64\msdia140.dll
|
129 | 138 | when: (not vs2022_installed.stat.exists) and (windows_version.stdout_lines[0] | regex_search('^(10\.|11\.|2016|2019|2022)'))
|
130 | 139 |
|
| 140 | +# Reboot The Machine After VS Installation |
131 | 141 | - name: Reboot machine after Visual Studio installation
|
132 | 142 | win_reboot:
|
133 | 143 | reboot_timeout: 1800
|
134 | 144 | shutdown_timeout: 1800
|
135 |
| - when: (not vs2022_installed.stat.exists) and (windows_version.stdout_lines[0] | regex_search('^(10\.|11\.|2016|2019|2022)')) |
| 145 | + when: (not vs2022_installed.stat.exists) |
136 | 146 | tags:
|
137 | 147 | - reboot
|
0 commit comments