|
19 | 19 |
|
20 | 20 | - uses: SpecialKO/GA-setup-cpp-n20@master
|
21 | 21 |
|
| 22 | + - name: Uninstall MSVC Toolset (latest) components |
| 23 | + run: | |
| 24 | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" |
| 25 | + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" |
| 26 | + $componentsToRemove= @( |
| 27 | + "Microsoft.VisualStudio.Component.VC.ATL" |
| 28 | + "Microsoft.VisualStudio.Component.VC.ATLMFC" |
| 29 | + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" |
| 30 | + "Microsoft.VisualStudio.Component.VC.CLI.Support" |
| 31 | + ) |
| 32 | + [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_} |
| 33 | + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') |
| 34 | + # should be run twice |
| 35 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 36 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 37 | + |
| 38 | + - name: Install MSVC Toolset (v14.36-17.6) components |
| 39 | + run: | |
| 40 | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" |
| 41 | + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" |
| 42 | + $componentsToRemove= @( |
| 43 | + "Microsoft.VisualStudio.Component.VC.14.36.17.6.ATL" |
| 44 | + "Microsoft.VisualStudio.Component.VC.14.36.17.6.MFC" |
| 45 | + "Microsoft.VisualStudio.Component.VC.14.36.17.6.x86.x64" |
| 46 | + "Microsoft.VisualStudio.Component.VC.14.36.17.6.CLI.Support" |
| 47 | + ) |
| 48 | + [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --add " + $_} |
| 49 | + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') |
| 50 | + # should be run twice |
| 51 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 52 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 53 | +
|
22 | 54 | - uses: microsoft/setup-msbuild@v2
|
23 | 55 | with:
|
24 | 56 | vs-version: '[17.0,18.0)'
|
|
0 commit comments