[windows] Add Windows Server 2025 with Visual Studio 2026 (#13635)
This commit is contained in:
@@ -15,10 +15,14 @@ $imageMinorVersion = $imageVersionComponents[1]
|
||||
$imageDataFile = $env:IMAGEDATA_FILE
|
||||
$githubUrl = "https://github.com/actions/runner-images/blob"
|
||||
|
||||
if (Test-IsWin25) {
|
||||
$imageLabel = "windows-2025"
|
||||
$softwareUrl = "${githubUrl}/win25/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2025-Readme.md"
|
||||
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win25%2F$imageMajorVersion.$imageMinorVersion"
|
||||
if ((Test-IsWin25) -and $env:INSTALL_VS_2026) {
|
||||
$imageLabel = "windows-2025-vs2026"
|
||||
$softwareUrl = "${githubUrl}/win25-vs2026/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2025-VS2026-Readme.md"
|
||||
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win25-vs2026%2F$imageMajorVersion.$imageMinorVersion"
|
||||
} elseif (Test-IsWin25) {
|
||||
$imageLabel = "windows-2025"
|
||||
$softwareUrl = "${githubUrl}/win25/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2025-Readme.md"
|
||||
$releaseUrl = "https://github.com/actions/runner-images/releases/tag/win25%2F$imageMajorVersion.$imageMinorVersion"
|
||||
} elseif (Test-IsWin22) {
|
||||
$imageLabel = "windows-2022"
|
||||
$softwareUrl = "${githubUrl}/win22/$imageMajorVersion.$imageMinorVersion/images/windows/Windows2022-Readme.md"
|
||||
|
||||
@@ -65,7 +65,13 @@ $cmdlineToolsArchPath = Invoke-DownloadWithRetry $cmdlineToolsUrl
|
||||
|
||||
Test-FileChecksum $cmdlineToolsArchPath -ExpectedSHA256Sum $androidToolset.hash
|
||||
|
||||
Expand-7ZipArchive -Path $cmdlineToolsArchPath -DestinationPath "${SDKInstallRoot}\cmdline-tools"
|
||||
$cmdlineToolsPath = Join-Path -Path $SDKInstallRoot -ChildPath "cmdline-tools"
|
||||
if (Test-Path "$cmdlineToolsPath\latest") {
|
||||
Write-Host "Removing previous cmdline-tools installation from Visual Studio workload"
|
||||
Remove-Item "$cmdlineToolsPath\latest" -Recurse -Force
|
||||
}
|
||||
|
||||
Expand-7ZipArchive -Path $cmdlineToolsArchPath -DestinationPath $cmdlineToolsPath
|
||||
|
||||
# cmdline tools should be installed in ${SDKInstallRoot}\cmdline-tools\latest\bin, but archive contains ${SDKInstallRoot}\cmdline-tools\bin
|
||||
# we need to create the proper folder structure
|
||||
|
||||
@@ -9,7 +9,7 @@ Install-VisualStudio `
|
||||
-Version $vsToolset.subversion `
|
||||
-Edition $vsToolset.edition `
|
||||
-Channel $vsToolset.channel `
|
||||
-InstallChannel $vsToolset.installChannel `
|
||||
-InstallChannelUri $vsToolset.installChannelUri `
|
||||
-RequiredComponents $vsToolset.workloads `
|
||||
-ExtraArgs "--allWorkloads --includeRecommended --remove Component.CPython3.x64"
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ Function Install-VisualStudio {
|
||||
|
||||
.PARAMETER Channel
|
||||
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 InstallChannelUri
|
||||
The InstallChannelUri of Visual Studio that will be installed. Optional parameter.
|
||||
|
||||
.PARAMETER RequiredComponents
|
||||
The list of required components. Required parameter.
|
||||
@@ -30,17 +30,24 @@ Function Install-VisualStudio {
|
||||
[Parameter(Mandatory)] [String] $Version,
|
||||
[Parameter(Mandatory)] [String] $Edition,
|
||||
[Parameter(Mandatory)] [String] $Channel,
|
||||
[String] $InstallChannel = "",
|
||||
[String] $InstallChannelUri = "",
|
||||
[Parameter(Mandatory)] [String[]] $RequiredComponents,
|
||||
[String] $ExtraArgs = ""
|
||||
)
|
||||
|
||||
|
||||
$bootstrapperUrl = "https://aka.ms/vs/${Version}/postGRO-${Channel}/vs_${Edition}.exe"
|
||||
|
||||
if (-not $env:INSTALL_VS_2026) {
|
||||
$bootstrapperUrl = "https://aka.ms/vs/${Version}/postGRO-${Channel}/vs_${Edition}.exe"
|
||||
} else {
|
||||
$bootstrapperUrl = "https://aka.ms/vs/${Version}/${Channel}/vs_${Edition}.exe"
|
||||
}
|
||||
$channelUri = "https://aka.ms/vs/${Version}/${Channel}/channel"
|
||||
$channelId = "VisualStudio.${Version}.Release"
|
||||
$productId = "Microsoft.VisualStudio.Product.${Edition}"
|
||||
$installChannelUri = "https://aka.ms/vs/${Version}/${Channel}/${installchannel}/channel"
|
||||
if (-not [string]::IsNullOrEmpty($InstallChannelUri)) {
|
||||
$installChannelUri = $InstallChannelUri
|
||||
} else {
|
||||
$installChannelUri = $channelUri
|
||||
}
|
||||
|
||||
Write-Host "Downloading Bootstrapper ..."
|
||||
$bootstrapperFilePath = Invoke-DownloadWithRetry $BootstrapperUrl
|
||||
@@ -51,11 +58,11 @@ Function Install-VisualStudio {
|
||||
try {
|
||||
$responseData = @{
|
||||
"installChannelUri" = $installChannelUri
|
||||
"channelUri" = $channelUri
|
||||
"channelId" = $channelId
|
||||
"productId" = $productId
|
||||
"arch" = "x64"
|
||||
"add" = $RequiredComponents | ForEach-Object { "$_;includeRecommended" }
|
||||
"channelUri" = $channelUri
|
||||
"channelId" = $channelId
|
||||
"productId" = $productId
|
||||
"arch" = "x64"
|
||||
"add" = $RequiredComponents | ForEach-Object { "$_;includeRecommended" }
|
||||
}
|
||||
|
||||
# Create json file with response data
|
||||
|
||||
Reference in New Issue
Block a user