[Windows] Implement installation helpers refactoring (#8865)

* [Windows] Refactor base Installer helper functions

* Fix helper name

* Fix name gen logic and improve error handling

* Fix hash checking logic

* Fix Install-VsixExtension invocation

* Fix variable name in Install-OpenSSL.ps1

* Fix type for git downloadUrl
This commit is contained in:
Vasilii Polikarpov
2023-11-22 15:14:08 +01:00
committed by GitHub
parent 46f21c4413
commit d3e630f774
46 changed files with 361 additions and 462 deletions

View File

@@ -6,11 +6,11 @@
# Install latest PHP in chocolatey
$installDir = "c:\tools\php"
$phpMajorMinor = (Get-ToolsetContent).php.version
$phpVersionToInstall = Get-LatestChocoPackageVersion -TargetVersion $phpMajorMinor -PackageName "php"
Choco-Install -PackageName php -ArgumentList "--params", "/InstallDir:$installDir", "--version=$phpVersionToInstall"
$phpVersionToInstall = Resolve-ChocoPackageVersion -PackageName "php" -TargetVersion $phpMajorMinor
Install-ChocoPackage php -ArgumentList "--params", "/InstallDir:$installDir", "--version=$phpVersionToInstall"
# Install latest Composer in chocolatey
Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir"
Install-ChocoPackage composer -ArgumentList "--install-args", "/DEV=$installDir /PHP=$installDir"
# update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions.
((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace ';extension=openssl','extension=openssl') | Set-Content -Path $installDir\php.ini