[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
@@ -66,14 +66,19 @@ Function Install-VisualStudio {
$responseDataPath = "$env:TEMP\vs_install_response.json"
$responseData | ConvertTo-Json | Out-File -FilePath $responseDataPath
$installStartTime = Get-Date
Write-Host "Starting Install ..."
$bootstrapperArgumentList = ('/c', $bootstrapperFilePath, '--in', $responseDataPath, $ExtraArgs, '--quiet', '--norestart', '--wait', '--nocache' )
Write-Host "Bootstrapper arguments: $bootstrapperArgumentList"
$process = Start-Process -FilePath cmd.exe -ArgumentList $bootstrapperArgumentList -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0 -or $exitCode -eq 3010) {
Write-Host "Installation successful"
$installCompleteTime = [math]::Round(($(Get-Date) - $installStartTime).TotalSeconds, 2)
if ($exitCode -eq 0) {
Write-Host "Installation successful in $installCompleteTime seconds"
return $exitCode
} elseif ($exitCode -eq 3010) {
Write-Host "Installation successful in $installCompleteTime seconds. Reboot is required."
return $exitCode
} else {
Write-Host "Non zero exit code returned by the installation process : $exitCode"