mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
[windows 22 & 25 ] Upgrade visual studio to postGRO channel (#11595)
* [windows 22 and 25 Upgrade visual studio to postGRO * Add condition for windows 19 to skip * [Windows] Update Vs installation script * Refactor the visual studio installation script * Fix windows 19 faliure * Fix windows 19 visual studio failure * [windows] Fix Windows 19 failure * Add condition for windows 19 * [windows] Fix windows 19 failure * [windows] update script by changing the condition syntax * Make installchannel as optioanl parametr * Update Installer script * [ windows ] Update the installation script with conditional statement * Update the installation script * Update toolsets * Update the channel ID * Update channel ID * Resolve conflicts * Resolve conflicts
This commit is contained in:
committed by
GitHub
parent
9b2b536f10
commit
b5421c9536
@@ -2,17 +2,30 @@
|
|||||||
## File: Install-VisualStudio.ps1
|
## File: Install-VisualStudio.ps1
|
||||||
## Desc: Install Visual Studio
|
## Desc: Install Visual Studio
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
$vsToolset = (Get-ToolsetContent).visualStudio
|
$vsToolset = (Get-ToolsetContent).visualStudio
|
||||||
|
|
||||||
# Install VS
|
if (Test-IsWin19) {
|
||||||
Install-VisualStudio `
|
# Install Visual Studio for Windows 19
|
||||||
|
Install-VisualStudio `
|
||||||
-Version $vsToolset.subversion `
|
-Version $vsToolset.subversion `
|
||||||
-Edition $vsToolset.edition `
|
-Edition $vsToolset.edition `
|
||||||
-Channel $vsToolset.channel `
|
-Channel $vsToolset.channel `
|
||||||
-RequiredComponents $vsToolset.workloads `
|
-RequiredComponents $vsToolset.workloads `
|
||||||
-ExtraArgs "--allWorkloads --includeRecommended --remove Component.CPython3.x64" `
|
-ExtraArgs "--allWorkloads --includeRecommended --remove Component.CPython3.x64" `
|
||||||
-SignatureThumbprint $vsToolset.signature
|
-SignatureThumbprint $vsToolset.signature
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (Test-IsWin22) -or (Test-IsWin25) ) {
|
||||||
|
# Install Visual Studio for Windows 22 and 25 with InstallChannel
|
||||||
|
Install-VisualStudio `
|
||||||
|
-Version $vsToolset.subversion `
|
||||||
|
-Edition $vsToolset.edition `
|
||||||
|
-Channel $vsToolset.channel `
|
||||||
|
-InstallChannel $vsToolset.installChannel `
|
||||||
|
-RequiredComponents $vsToolset.workloads `
|
||||||
|
-ExtraArgs "--allWorkloads --includeRecommended --remove Component.CPython3.x64" `
|
||||||
|
-SignatureThumbprint $vsToolset.signature
|
||||||
|
}
|
||||||
|
|
||||||
# Find the version of VS installed for this instance
|
# Find the version of VS installed for this instance
|
||||||
# Only supports a single instance
|
# Only supports a single instance
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ Function Install-VisualStudio {
|
|||||||
.PARAMETER Channel
|
.PARAMETER Channel
|
||||||
The channel of Visual Studio that will be installed. Required parameter.
|
The channel of Visual Studio that will be installed. Required parameter.
|
||||||
|
|
||||||
|
.PARAMETER InstallChannel
|
||||||
|
The InstallChannelUri of Visual Studio that will be installed. Required parameter.
|
||||||
|
|
||||||
.PARAMETER RequiredComponents
|
.PARAMETER RequiredComponents
|
||||||
The list of required components. Required parameter.
|
The list of required components. Required parameter.
|
||||||
|
|
||||||
@@ -27,15 +30,22 @@ Function Install-VisualStudio {
|
|||||||
[Parameter(Mandatory)] [String] $Version,
|
[Parameter(Mandatory)] [String] $Version,
|
||||||
[Parameter(Mandatory)] [String] $Edition,
|
[Parameter(Mandatory)] [String] $Edition,
|
||||||
[Parameter(Mandatory)] [String] $Channel,
|
[Parameter(Mandatory)] [String] $Channel,
|
||||||
|
[String] $InstallChannel = "",
|
||||||
[Parameter(Mandatory)] [String[]] $RequiredComponents,
|
[Parameter(Mandatory)] [String[]] $RequiredComponents,
|
||||||
[String] $ExtraArgs = "",
|
[String] $ExtraArgs = "",
|
||||||
[Parameter(Mandatory)] [String[]] $SignatureThumbprint
|
[Parameter(Mandatory)] [String[]] $SignatureThumbprint
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if (-not (Test-IsWin19)) {
|
||||||
|
$bootstrapperUrl = "https://aka.ms/vs/${Version}/postGRO-${Channel}/vs_${Edition}.exe"
|
||||||
|
} else {
|
||||||
$bootstrapperUrl = "https://aka.ms/vs/${Version}/${Channel}/vs_${Edition}.exe"
|
$bootstrapperUrl = "https://aka.ms/vs/${Version}/${Channel}/vs_${Edition}.exe"
|
||||||
|
}
|
||||||
$channelUri = "https://aka.ms/vs/${Version}/${Channel}/channel"
|
$channelUri = "https://aka.ms/vs/${Version}/${Channel}/channel"
|
||||||
$channelId = "VisualStudio.${Version}.Release"
|
$channelId = "VisualStudio.${Version}.Release"
|
||||||
$productId = "Microsoft.VisualStudio.Product.${Edition}"
|
$productId = "Microsoft.VisualStudio.Product.${Edition}"
|
||||||
|
$installChannelUri = "https://aka.ms/vs/${Version}/${Channel}/${installchannel}/channel"
|
||||||
|
|
||||||
Write-Host "Downloading Bootstrapper ..."
|
Write-Host "Downloading Bootstrapper ..."
|
||||||
$bootstrapperFilePath = Invoke-DownloadWithRetry $BootstrapperUrl
|
$bootstrapperFilePath = Invoke-DownloadWithRetry $BootstrapperUrl
|
||||||
@@ -45,6 +55,7 @@ Function Install-VisualStudio {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$responseData = @{
|
$responseData = @{
|
||||||
|
"installChannelUri" = $installChannelUri
|
||||||
"channelUri" = $channelUri
|
"channelUri" = $channelUri
|
||||||
"channelId" = $channelId
|
"channelId" = $channelId
|
||||||
"productId" = $productId
|
"productId" = $productId
|
||||||
|
|||||||
@@ -180,6 +180,7 @@
|
|||||||
"subversion" : "17",
|
"subversion" : "17",
|
||||||
"edition" : "Enterprise",
|
"edition" : "Enterprise",
|
||||||
"channel": "release",
|
"channel": "release",
|
||||||
|
"installChannel": "658092423_1519083591",
|
||||||
"signature": [
|
"signature": [
|
||||||
"245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D",
|
"245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D",
|
||||||
"8F985BE8FD256085C90A95D3C74580511A1DB975"
|
"8F985BE8FD256085C90A95D3C74580511A1DB975"
|
||||||
|
|||||||
@@ -137,6 +137,7 @@
|
|||||||
"subversion" : "17",
|
"subversion" : "17",
|
||||||
"edition" : "Enterprise",
|
"edition" : "Enterprise",
|
||||||
"channel": "release",
|
"channel": "release",
|
||||||
|
"installChannel": "658092423_1519083591",
|
||||||
"signature": [
|
"signature": [
|
||||||
"245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D",
|
"245D262748012A4FE6CE8BA6C951A4C4AFBC3E5D",
|
||||||
"8F985BE8FD256085C90A95D3C74580511A1DB975"
|
"8F985BE8FD256085C90A95D3C74580511A1DB975"
|
||||||
|
|||||||
Reference in New Issue
Block a user