@@ -17,37 +17,17 @@ outputs:
17
17
runs :
18
18
using : composite
19
19
steps :
20
- # Reinstall VC15 (Visual Studio 2017) for PHP 7.4 using the suggested script
21
- # from https://github.com/actions/runner-images/issues/9701
22
- - name : Remove VC15 component for PHP 7.4
23
- if : ${{ inputs.version == '7.4' }}
24
- shell : pwsh
25
- run : |
26
- Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
27
- $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
28
- $componentsToRemove= @(
29
- "Microsoft.VisualStudio.Component.VC.v141.x86.x64"
30
- )
31
- [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_}
32
- $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
33
- # should be run twice
34
- $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
35
- $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
36
-
20
+ # Reinstall VC15 (Visual Studio 2017) for PHP 7.4 using a derivation of the
21
+ # script suggested in https://github.com/actions/runner-images/issues/9701
37
22
- name : Install VC15 component for PHP 7.4
38
23
if : ${{ inputs.version == '7.4' }}
39
24
shell : pwsh
40
25
run : |
41
26
Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
42
- $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
43
- $componentsToRemove= @(
44
- "Microsoft.VisualStudio.Component.VC.v141.x86.x64"
45
- )
46
- [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --add " + $_}
47
- $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
48
- # should be run twice
49
- $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
50
- $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
27
+ $installPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
28
+ $component = "Microsoft.VisualStudio.Component.VC.v141.x86.x64"
29
+ $args = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$installPath`"", '--add', $component, '--quiet', '--norestart', '--nocache')
30
+ $process = Start-Process -FilePath cmd.exe -ArgumentList $args -Wait -PassThru -WindowStyle Hidden
51
31
52
32
- name : Setup PHP SDK
53
33
id : setup-php
0 commit comments