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
22 lines
676 B
C++
22 lines
676 B
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
#include "pch.h"
|
|
#include "VsDevCmdGenerator.h"
|
|
|
|
using namespace Microsoft::Terminal::Settings::Model;
|
|
|
|
std::wstring VsDevCmdGenerator::GetProfileName(const VsSetupConfiguration::VsSetupInstance instance) const
|
|
{
|
|
std::wstring name{ L"Developer Command Prompt for VS " };
|
|
name.append(instance.GetProfileNameSuffix());
|
|
return name;
|
|
}
|
|
|
|
std::wstring VsDevCmdGenerator::GetProfileCommandLine(const VsSetupConfiguration::VsSetupInstance instance) const
|
|
{
|
|
std::wstring commandLine{ L"cmd.exe /k \"" + instance.GetDevCmdScriptPath() + L"\"" };
|
|
|
|
return commandLine;
|
|
}
|