From f84da18d1e3b10ab36caa507412219616d8f161f Mon Sep 17 00:00:00 2001 From: Charles Willis <5862883+trippwill@users.noreply.github.com> Date: Wed, 15 Sep 2021 23:20:06 +0100 Subject: [PATCH] Add profile generators for Visual Studio (#7774) This commit adds dynamic profile generators for Visual Studio Developer Command Prompt (VS2017+) and Visual Studio Developer PowerShell (VS2019.2+) Tested manually by deploying locally. My local environment has four instances of VS installed, one VS2017 and multiple channels of VS2019. We're wrapping the COM Visual Studio Setup Configuration API to query for VS instances and retrieve the relevant properties. Two different namespaces are used so the end-user can turn off one or the other. For instance, end user may prefer to always use Developer PowerShell. ## Validation Steps Performed 1. Build locally using Visual Studio 2019 2. Deploy CascadiaPackage 3. Verify entries exist in profiles menu 4. Verify entries exist in settings.json 5. Open each profile 6. Validate start-in directory 7. Validate environment variables are as expected 8. Uninstall Windows Terminal - Dev package 9. Repeat. Closes #3821 --- .github/actions/spelling/allow/apis.txt | 1 + .github/actions/spelling/expect/expect.txt | 1 + .../TerminalApp/TerminalAppLib.vcxproj | 7 +- .../BaseVisualStudioGenerator.cpp | 53 ++++ .../BaseVisualStudioGenerator.h | 41 +++ .../CascadiaSettings.cpp | 4 + ...crosoft.Terminal.Settings.ModelLib.vcxproj | 15 +- ...Terminal.Settings.ModelLib.vcxproj.filters | 24 ++ .../VsDevCmdGenerator.cpp | 21 ++ .../TerminalSettingsModel/VsDevCmdGenerator.h | 53 ++++ .../VsDevShellGenerator.cpp | 30 +++ .../VsDevShellGenerator.h | 50 ++++ .../VsSetupConfiguration.cpp | 112 ++++++++ .../VsSetupConfiguration.h | 240 ++++++++++++++++++ .../TerminalSettingsModel/packages.config | 1 + 15 files changed, 643 insertions(+), 10 deletions(-) create mode 100644 src/cascadia/TerminalSettingsModel/BaseVisualStudioGenerator.cpp create mode 100644 src/cascadia/TerminalSettingsModel/BaseVisualStudioGenerator.h create mode 100644 src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.cpp create mode 100644 src/cascadia/TerminalSettingsModel/VsDevCmdGenerator.h create mode 100644 src/cascadia/TerminalSettingsModel/VsDevShellGenerator.cpp create mode 100644 src/cascadia/TerminalSettingsModel/VsDevShellGenerator.h create mode 100644 src/cascadia/TerminalSettingsModel/VsSetupConfiguration.cpp create mode 100644 src/cascadia/TerminalSettingsModel/VsSetupConfiguration.h diff --git a/.github/actions/spelling/allow/apis.txt b/.github/actions/spelling/allow/apis.txt index 64d16180143..4b6fbe4f57b 100644 --- a/.github/actions/spelling/allow/apis.txt +++ b/.github/actions/spelling/allow/apis.txt @@ -66,6 +66,7 @@ iosfwd IPackage IPeasant isspace +ISetup IStorage istream IStringable diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index 1842360cf25..8e83ab3e437 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -2578,6 +2578,7 @@ VREDRAW vsc vscprintf VSCROLL +vsdevshell vsinfo vsnprintf vso diff --git a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj index 4d9b5d3dc72..e954e123b30 100644 --- a/src/cascadia/TerminalApp/TerminalAppLib.vcxproj +++ b/src/cascadia/TerminalApp/TerminalAppLib.vcxproj @@ -21,14 +21,12 @@ - true - @@ -379,7 +376,6 @@ - @@ -388,8 +384,8 @@ + - + DefaultTerminal.idl @@ -77,10 +77,14 @@ TerminalWarnings.idl + + + + DefaultTerminal.idl @@ -143,6 +147,9 @@ EnumMappings.idl + + + @@ -234,13 +241,13 @@ - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. +