mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
VsDev: reject VS instances which do not actually contain devshell/devcmd (#19352)
Closes #19169
This commit is contained in:
parent
46b9572e60
commit
1926c4601c
@ -26,12 +26,13 @@ namespace winrt::Microsoft::Terminal::Settings::Model
|
||||
void GenerateProfiles(const VsSetupConfiguration::VsSetupInstance& instance, bool hidden, std::vector<winrt::com_ptr<implementation::Profile>>& profiles) const override;
|
||||
|
||||
private:
|
||||
bool IsInstanceValid(const VsSetupConfiguration::VsSetupInstance&) const
|
||||
bool IsInstanceValid(const VsSetupConfiguration::VsSetupInstance& instance) const
|
||||
{
|
||||
// We only support version of VS from 15.0.
|
||||
// Per heaths: The [ISetupConfiguration] COM server only supports Visual Studio 15.0 and newer anyway.
|
||||
// Eliding the version range will improve the discovery performance by not having to parse or compare the versions.
|
||||
return true;
|
||||
std::error_code ec;
|
||||
return std::filesystem::exists(GetDevCmdScriptPath(instance), ec) && !ec;
|
||||
}
|
||||
|
||||
std::wstring GetProfileGuidSeed(const VsSetupConfiguration::VsSetupInstance& instance) const
|
||||
|
||||
@ -28,7 +28,8 @@ namespace winrt::Microsoft::Terminal::Settings::Model
|
||||
private:
|
||||
bool IsInstanceValid(const VsSetupConfiguration::VsSetupInstance& instance) const
|
||||
{
|
||||
return instance.VersionInRange(L"[16.2,)");
|
||||
std::error_code ec;
|
||||
return instance.VersionInRange(L"[16.2,)") && std::filesystem::exists(GetDevShellModulePath(instance), ec) && !ec;
|
||||
}
|
||||
|
||||
std::wstring GetProfileGuidSeed(const VsSetupConfiguration::VsSetupInstance& instance) const
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user