@@ -17,6 +17,38 @@ 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
+
37
+ - name : Install VC15 component for PHP 7.4
38
+ if : ${{ inputs.version == '7.4' }}
39
+ shell : pwsh
40
+ run : |
41
+ 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
51
+
20
52
- name : Setup PHP SDK
21
53
id : setup-php
22
54
0 commit comments