From 573c5aa999a097a7e901c6be423cb886581b077c Mon Sep 17 00:00:00 2001 From: V-Zabayrachny <79155496+V-Zabayrachny@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:31:48 +0300 Subject: [PATCH] [Windows] Add installer projects to VS on Windows-2022 (#4715) * [Windows] Add installer projects to VS on windows-2022 * [Windows] Improve the function Install-VsixExtension --- images/win/scripts/ImageHelpers/InstallHelpers.ps1 | 9 ++++++++- images/win/scripts/Installers/Install-Vsix.ps1 | 2 +- images/win/toolsets/toolset-2022.json | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index 4522bcf7f..30084aa47 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -270,10 +270,17 @@ function Install-VsixExtension $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 if ($Name -match "vsix") { - $process = Start-Process -FilePath "C:\Program Files (x86)\Microsoft Visual Studio\$VSversion\${vsEdition}\Common7\IDE\VSIXInstaller.exe" -ArgumentList $argumentList -Wait -PassThru + $process = Start-Process -FilePath "${installPath}\Microsoft Visual Studio\${VSversion}\${vsEdition}\Common7\IDE\VSIXInstaller.exe" -ArgumentList $argumentList -Wait -PassThru } else { diff --git a/images/win/scripts/Installers/Install-Vsix.ps1 b/images/win/scripts/Installers/Install-Vsix.ps1 index 23d75729f..405a4562b 100644 --- a/images/win/scripts/Installers/Install-Vsix.ps1 +++ b/images/win/scripts/Installers/Install-Vsix.ps1 @@ -12,7 +12,7 @@ if (-not $vsixPackagesList) { $vsVersion = $toolset.visualStudio.Version $vsixPackagesList | ForEach-Object { - # Retrieve cdn endpoint to avoid HTTP error 429 https://github.com/actions/virtual-environments/issues/3074 + # Retrieve cdn endpoint to avoid HTTP error 429 https://github.com/actions/virtual-environments/issues/3074 $vsixPackage = Get-VsixExtenstionFromMarketplace -ExtensionMarketPlaceName $_ Install-VsixExtension -Url $vsixPackage.DownloadUri -Name $vsixPackage.FileName -VSversion $vsVersion } diff --git a/images/win/toolsets/toolset-2022.json b/images/win/toolsets/toolset-2022.json index 534114d0c..2e6151a44 100644 --- a/images/win/toolsets/toolset-2022.json +++ b/images/win/toolsets/toolset-2022.json @@ -241,7 +241,9 @@ "Component.MDD.Linux", "wasm.tools" ], - "vsix": [] + "vsix": [ + "VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects" + ] }, "docker": { "images": [