[Windows] use VsixInstaller from the installer (#8103)

This commit is contained in:
Mikhail Koliada
2023-08-17 10:12:47 +02:00
committed by GitHub
parent e6705a3f9c
commit a951af97cd
3 changed files with 6 additions and 16 deletions

View File

@@ -272,8 +272,6 @@ function Install-VsixExtension
[Parameter(Mandatory = $true)]
[string] $Name,
[string] $FilePath,
[Parameter(Mandatory = $true)]
[string] $VSversion,
[int] $Retries = 20,
[switch] $InstallOnly
)
@@ -288,20 +286,14 @@ function Install-VsixExtension
do
{
Write-Host "Starting Install $Name..."
$vsEdition = (Get-ToolsetContent).visualStudio.edition
try
{
$installPath = ${env:ProgramFiles(x86)}
if (Test-IsWin22)
{
$installPath = ${env:ProgramFiles}
}
#There are 2 types of packages at the moment - exe and vsix
# There are 2 types of packages at the moment - exe and vsix
if ($Name -match "vsix")
{
$process = Start-Process -FilePath "${installPath}\Microsoft Visual Studio\${VSversion}\${vsEdition}\Common7\IDE\VSIXInstaller.exe" -ArgumentList $argumentList -Wait -PassThru
$process = Start-Process -FilePath "${installPath}\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe" -ArgumentList $argumentList -Wait -PassThru
}
else
{
@@ -327,7 +319,8 @@ function Install-VsixExtension
$Retries--
if ($Retries -eq 0) {
Write-Host "The $Name couldn't be installed after 20 attempts."
}else {
exit 1
} else {
Write-Host "Waiting 10 seconds before retrying. Retries left: $Retries"
Start-Sleep -Seconds 10
}