@@ -17,6 +17,38 @@ outputs:
1717runs :
1818 using : composite
1919 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+
2052 - name : Setup PHP SDK
2153 id : setup-php
2254 uses : php/setup-php-sdk@v0.8
0 commit comments