|
56 | 56 | cd .. |
57 | 57 | Remove-Item -LiteralPath "temp" -Force -Recurse |
58 | 58 | |
| 59 | + - name: Delete components |
| 60 | + run: | |
| 61 | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" |
| 62 | + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" |
| 63 | + $componentsToRemove= @( |
| 64 | + "Microsoft.VisualStudio.Component.VC.ATL" |
| 65 | + ) |
| 66 | + [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_} |
| 67 | + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') |
| 68 | + # should be run twice |
| 69 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 70 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 71 | + |
| 72 | + - name: Install components |
| 73 | + run: | |
| 74 | + Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" |
| 75 | + $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" |
| 76 | + $componentsToRemove= @( |
| 77 | + "Microsoft.VisualStudio.Component.VC.v141.ATL" |
| 78 | + "Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL" |
| 79 | + ) |
| 80 | + [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --add " + $_} |
| 81 | + $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') |
| 82 | + # should be run twice |
| 83 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 84 | + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden |
| 85 | +
|
59 | 86 | - name: Setup MSBuild.exe |
60 | 87 | uses: microsoft/setup-msbuild@v1.1 |
61 | 88 |
|
|
0 commit comments