Skip to content

Commit 344dc33

Browse files
authored
Add Visual Studio 2026 support to InstallVisualStudio.ps1 (#64406)
1 parent 249b29c commit 344dc33

15 files changed

+217
-63
lines changed

eng/scripts/InstallVisualStudio.ps1

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
Enterprise
1212
.PARAMETER Channel
1313
Selects which channel of Visual Studio to install. Must be one of these values:
14-
Release (the default)
15-
Preview
14+
Release/Stable (the default)
15+
Preview/Insiders
1616
.PARAMETER Version
1717
Selects which version of Visual Studio to install. Must be one of these values:
1818
2022
19+
2026
1920
.PARAMETER InstallPath
2021
The location on disk where Visual Studio should be installed or updated. Default path is location of latest
2122
existing installation of the specified edition, if any. If that VS edition is not currently installed, default
@@ -35,9 +36,9 @@
3536
param(
3637
[ValidateSet('BuildTools','Community', 'Professional', 'Enterprise')]
3738
[string]$Edition = 'Community',
38-
[ValidateSet('Release', 'Preview', 'IntPreview', 'Dogfood')]
39+
[ValidateSet('Release', 'Stable', 'Preview', 'Insiders', 'IntPreview', 'Dogfood')]
3940
[string]$Channel = 'Release',
40-
[ValidateSet('2022')]
41+
[ValidateSet('2022', '2026')]
4142
[string]$Version = '2022',
4243
[string]$InstallPath,
4344
[switch]$Passive,
@@ -67,20 +68,42 @@ $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
6768
if ("$Version" -eq "2022") {
6869
$vsversion = 17;
6970
}
70-
$channelUri = "https://aka.ms/vs/$vsversion/release"
71+
elseif ("$Version" -eq "2026") {
72+
$vsversion = 18;
73+
}
74+
75+
# Normalize channel names (Stable=Release, Insiders=Preview, Dogfood=IntPreview)
76+
switch ($Channel) {
77+
'Stable' { $Channel = 'Release' }
78+
'Insiders' { $Channel = 'Preview' }
79+
'Dogfood' { $Channel = 'IntPreview' }
80+
}
81+
7182
$responseFileName = "vs.$vsversion"
7283
if ("$Edition" -eq "BuildTools") {
7384
$responseFileName += ".buildtools"
7485
}
75-
if ("$Channel" -eq "Dogfood") {
76-
$Channel = "IntPreview"
77-
}
86+
87+
# Channel URIs differ between VS 2022 and VS 2026+
88+
# VS 2022: release, pre, intpreview
89+
# VS 2026+: stable, insiders, intpreview (canary)
7890
if ("$Channel" -eq "Preview") {
7991
$responseFileName += ".preview"
80-
$channelUri = "https://aka.ms/vs/$vsversion/pre"
92+
if ($vsversion -ge 18) {
93+
$channelUri = "https://aka.ms/vs/$vsversion/insiders"
94+
} else {
95+
$channelUri = "https://aka.ms/vs/$vsversion/pre"
96+
}
8197
} elseif ("$Channel" -eq "IntPreview") {
8298
$responseFileName += ".intpreview"
8399
$channelUri = "https://aka.ms/vs/$vsversion/intpreview"
100+
} else {
101+
# Release channel
102+
if ($vsversion -ge 18) {
103+
$channelUri = "https://aka.ms/vs/$vsversion/stable"
104+
} else {
105+
$channelUri = "https://aka.ms/vs/$vsversion/release"
106+
}
84107
}
85108

86109
$responseFile = "$PSScriptRoot\$responseFileName.json"
@@ -107,11 +130,15 @@ if (-not $InstallPath) {
107130
}
108131

109132
if (-not $InstallPath) {
110-
if ($vsversion -eq "17") {
133+
if (($vsversion -eq 17) -or ($vsversion -eq 18)) {
111134
$pathPrefix = "${env:ProgramFiles}";
112135
}
113136
if ("$Channel" -eq "Preview") {
114-
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_Pre"
137+
if ($vsversion -ge 18) {
138+
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_Insiders"
139+
} else {
140+
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_Pre"
141+
}
115142
} elseif ("$Channel" -eq "IntPreview") {
116143
$InstallPath = "$pathPrefix\Microsoft Visual Studio\$Version\${Edition}_IntPre"
117144
} else {

eng/scripts/vs.17.buildtools.intpreview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
2121
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
2222
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
23-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2424
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
2525
"Microsoft.VisualStudio.Workload.MSBuildTools",
2626
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",

eng/scripts/vs.17.buildtools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
2121
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
2222
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
23-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2424
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
2525
"Microsoft.VisualStudio.Workload.MSBuildTools",
2626
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",

eng/scripts/vs.17.buildtools.preview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
2121
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
2222
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
23-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2424
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
2525
"Microsoft.VisualStudio.Workload.MSBuildTools",
2626
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",

eng/scripts/vs.17.intpreview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
1818
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
1919
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
20-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
20+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2121
"Microsoft.VisualStudio.Workload.ManagedDesktop",
2222
"Microsoft.VisualStudio.Workload.NativeDesktop",
2323
"Microsoft.VisualStudio.Workload.NetWeb",

eng/scripts/vs.17.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
1818
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
1919
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
20-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
20+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2121
"Microsoft.VisualStudio.Workload.ManagedDesktop",
2222
"Microsoft.VisualStudio.Workload.NativeDesktop",
2323
"Microsoft.VisualStudio.Workload.NetWeb",

eng/scripts/vs.17.preview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64",
1818
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL.ARM64",
1919
"Microsoft.VisualStudio.Component.VC.14.29.16.11.ATL",
20-
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
20+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
2121
"Microsoft.VisualStudio.Workload.ManagedDesktop",
2222
"Microsoft.VisualStudio.Workload.NativeDesktop",
2323
"Microsoft.VisualStudio.Workload.NetWeb",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"channelUri": "https://aka.ms/vs/18/intpreview/channel",
3+
"channelId": "VisualStudio.18.IntPreview",
4+
"includeRecommended": false,
5+
"addProductLang": [
6+
"en-US"
7+
],
8+
"add": [
9+
"Microsoft.Net.Component.4.6.2.TargetingPack",
10+
"Microsoft.Net.Component.4.7.2.SDK",
11+
"Microsoft.Net.Component.4.7.2.TargetingPack",
12+
"Microsoft.VisualStudio.Component.FSharp.MSBuild",
13+
"Microsoft.VisualStudio.Component.NuGet",
14+
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
15+
"Microsoft.VisualStudio.Component.VC.ATL",
16+
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
17+
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
18+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
19+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ARM64",
20+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64",
21+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL.ARM64",
22+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
24+
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
25+
"Microsoft.VisualStudio.Workload.MSBuildTools",
26+
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",
27+
"Microsoft.VisualStudio.Workload.VCTools",
28+
"Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools",
29+
"Microsoft.VisualStudio.Workload.WebBuildTools"
30+
]
31+
}

eng/scripts/vs.18.buildtools.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"channelUri": "https://aka.ms/vs/18/stable/channel",
3+
"channelId": "VisualStudio.18.Release",
4+
"includeRecommended": false,
5+
"addProductLang": [
6+
"en-US"
7+
],
8+
"add": [
9+
"Microsoft.Net.Component.4.6.2.TargetingPack",
10+
"Microsoft.Net.Component.4.7.2.SDK",
11+
"Microsoft.Net.Component.4.7.2.TargetingPack",
12+
"Microsoft.VisualStudio.Component.FSharp.MSBuild",
13+
"Microsoft.VisualStudio.Component.NuGet",
14+
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
15+
"Microsoft.VisualStudio.Component.VC.ATL",
16+
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
17+
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
18+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
19+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ARM64",
20+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64",
21+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL.ARM64",
22+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
24+
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
25+
"Microsoft.VisualStudio.Workload.MSBuildTools",
26+
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",
27+
"Microsoft.VisualStudio.Workload.VCTools",
28+
"Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools",
29+
"Microsoft.VisualStudio.Workload.WebBuildTools"
30+
]
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"channelUri": "https://aka.ms/vs/18/insiders/channel",
3+
"channelId": "VisualStudio.18.Preview",
4+
"includeRecommended": false,
5+
"addProductLang": [
6+
"en-US"
7+
],
8+
"add": [
9+
"Microsoft.Net.Component.4.6.2.TargetingPack",
10+
"Microsoft.Net.Component.4.7.2.SDK",
11+
"Microsoft.Net.Component.4.7.2.TargetingPack",
12+
"Microsoft.VisualStudio.Component.FSharp.MSBuild",
13+
"Microsoft.VisualStudio.Component.NuGet",
14+
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
15+
"Microsoft.VisualStudio.Component.VC.ATL",
16+
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
17+
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
18+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
19+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ARM64",
20+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.x86.x64",
21+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL.ARM64",
22+
"Microsoft.VisualStudio.Component.VC.14.44.17.14.ATL",
23+
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
24+
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
25+
"Microsoft.VisualStudio.Workload.MSBuildTools",
26+
"Microsoft.VisualStudio.Workload.NetCoreBuildTools",
27+
"Microsoft.VisualStudio.Workload.VCTools",
28+
"Microsoft.VisualStudio.Workload.VisualStudioExtensionBuildTools",
29+
"Microsoft.VisualStudio.Workload.WebBuildTools"
30+
]
31+
}

0 commit comments

Comments
 (0)