diff --git a/src/VisualStudio/Commands/InstallCommand.cs b/src/VisualStudio/Commands/InstallCommand.cs index c20e58e..a5b984f 100644 --- a/src/VisualStudio/Commands/InstallCommand.cs +++ b/src/VisualStudio/Commands/InstallCommand.cs @@ -30,8 +30,13 @@ public override async Task ExecuteAsync(TextWriter output) args.AddRange(Descriptor.ExtraArguments); + // See also InstallerService.RunAsync where we do this mapping too. + var vs = Descriptor.Channel == null || Descriptor.Channel == Channel.Release ? "16" : "17"; + // TODO: for now, we assume we're always doing an install. - var installBase = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft Visual Studio", "2019"); + var installBase = vs == "16" ? + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft Visual Studio", "2019") : + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft Visual Studio", "2022"); // There is at least one install already, so use nicknames for the new one. if (Directory.Exists(installBase) && !args.Contains("--nickname")) diff --git a/src/VisualStudio/InstallerService.cs b/src/VisualStudio/InstallerService.cs index ced0648..3dd5dfc 100644 --- a/src/VisualStudio/InstallerService.cs +++ b/src/VisualStudio/InstallerService.cs @@ -28,6 +28,11 @@ public Task ModifyAsync(string channelUri, Sku? sku, IEnumerable args, T Task RunAsync(string command, Channel? channel, Sku? sku, IEnumerable args, TextWriter output) { var vs = channel == null || channel == Channel.Release ? "16" : "17"; + + // Microsoft.VisualStudio.Workload.NetCoreTools > Microsoft.NetCore.Component.DevelopmentTools + if (vs == "17") + args = args.Select(arg => arg == "Microsoft.VisualStudio.Workload.NetCoreTools" ? "Microsoft.NetCore.Component.DevelopmentTools" : arg); + return RunAsync(command, $"https://aka.ms/vs/{vs}/{MapChannel(channel)}", sku, args, output); }