mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-13 08:14:06 +07:00
Add support for pre-installed PHP
This commit is contained in:
@ -401,6 +401,15 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) {
|
||||
}
|
||||
$status = "Installed"
|
||||
$extra_version = ""
|
||||
if($version -eq 'pre') {
|
||||
if($null -ne $installed) {
|
||||
$version = $installed.MajorMinorVersion
|
||||
$env:update = 'false'
|
||||
} else {
|
||||
Add-Log $cross "PHP" "No pre-installed PHP version found"
|
||||
Write-Error "No pre-installed PHP version found" -ErrorAction Stop
|
||||
}
|
||||
}
|
||||
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
||||
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
||||
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
|
||||
|
Reference in New Issue
Block a user