mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-10 21:24:22 +00:00
Add a second way of detecting whether DefTerm is available (#15040)
This will become meaningful soon.
This commit is contained in:
@@ -1082,7 +1082,21 @@ bool CascadiaSettings::IsDefaultTerminalAvailable() noexcept
|
||||
DWORDLONG dwlConditionMask = 0;
|
||||
VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL);
|
||||
|
||||
return VerifyVersionInfoW(&osver, VER_BUILDNUMBER, dwlConditionMask) != FALSE;
|
||||
if (VerifyVersionInfoW(&osver, VER_BUILDNUMBER, dwlConditionMask) != FALSE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool isOtherwiseAvailable = [] {
|
||||
wil::unique_hkey key;
|
||||
const auto lResult = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\SystemSettings\\SettingId\\SystemSettings_Developer_Mode_Setting_DefaultTerminalApp",
|
||||
0,
|
||||
KEY_READ,
|
||||
&key);
|
||||
return static_cast<bool>(key) && ERROR_SUCCESS == lResult;
|
||||
}();
|
||||
return isOtherwiseAvailable;
|
||||
}
|
||||
|
||||
bool CascadiaSettings::IsDefaultTerminalSet() noexcept
|
||||
|
||||
Reference in New Issue
Block a user