From 88fb99b59232a4bd6789206d77b86ab9bc003c12 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 16 Jan 2020 10:16:44 +0530 Subject: [PATCH] Fix logs on windows for pre-installed version --- src/scripts/win32.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index c415256b..0dea59bb 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -171,6 +171,7 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) { } } Step-Log "Setup PHP" +$status = "Installed" if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.')))) { if ($version -lt '7.0') { Install-Module -Name VcRedist -Force @@ -181,9 +182,11 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version } Install-Php -Version $version -Architecture $arch -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 -} -else { - Update-Php $php_dir >$null 2>&1 +} else { + $updated = Update-Php $php_dir >$null 2>&1 + if($updated -eq $False) { + $status = "Found" + } } $installed = Get-Php -Path $php_dir @@ -195,4 +198,4 @@ if ($version -eq 'master') { Set-PhpIniKey -Key 'opcache.jit_buffer_size' -Value '256M' -Path $php_dir Set-PhpIniKey -Key 'opcache.jit' -Value '1235' -Path $php_dir } -Add-Log $tick "PHP" "Installed PHP $($installed.FullVersion)" +Add-Log $tick "PHP" "$status PHP $($installed.FullVersion)"