mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-03 16:21:46 +00:00
More readable Windows version logging
This commit is contained in:
@@ -26,6 +26,30 @@ bool Util::GetRealWindowsVersion(OSVERSIONINFOW& osInfo)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Util::GetWindowsName(const OSVERSIONINFOW& os)
|
||||
{
|
||||
DWORD major = os.dwMajorVersion;
|
||||
DWORD minor = os.dwMinorVersion;
|
||||
DWORD build = os.dwBuildNumber;
|
||||
|
||||
if (major == 10 && build >= 22000)
|
||||
return "Windows 11";
|
||||
if (major == 10)
|
||||
return "Windows 10";
|
||||
if (major == 6 && minor == 3)
|
||||
return "Windows 8.1";
|
||||
if (major == 6 && minor == 2)
|
||||
return "Windows 8";
|
||||
if (major == 6 && minor == 1)
|
||||
return "Windows 7";
|
||||
if (major == 6 && minor == 0)
|
||||
return "Windows Vista";
|
||||
if (major == 5 && minor == 1)
|
||||
return "Windows XP";
|
||||
|
||||
return "Unknown Windows Version";
|
||||
}
|
||||
|
||||
std::filesystem::path Util::DllPath()
|
||||
{
|
||||
static std::filesystem::path dll;
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Util
|
||||
bool GetDLLVersion(std::wstring dllPath, version_t* versionOut);
|
||||
bool GetDLLVersion(std::wstring dllPath, xess_version_t* versionOut);
|
||||
bool GetRealWindowsVersion(OSVERSIONINFOW& osInfo);
|
||||
std::string GetWindowsName(const OSVERSIONINFOW& os);
|
||||
};
|
||||
|
||||
inline void ThrowIfFailed(HRESULT hr)
|
||||
|
||||
@@ -848,12 +848,12 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||
|
||||
spdlog::info("");
|
||||
if (Util::GetRealWindowsVersion(winVer))
|
||||
spdlog::info("Windows version: {}.{}.{} ({})", winVer.dwMajorVersion, winVer.dwMinorVersion, winVer.dwBuildNumber, winVer.dwPlatformId);
|
||||
spdlog::info("Windows version: {} ({}.{}.{})", Util::GetWindowsName(winVer), winVer.dwMajorVersion, winVer.dwMinorVersion, winVer.dwBuildNumber, winVer.dwPlatformId);
|
||||
else
|
||||
spdlog::warn("Can't read windows version");
|
||||
spdlog::info("");
|
||||
CheckQuirks();
|
||||
|
||||
|
||||
// OptiFG & Overlay Checks
|
||||
if (Config::Instance()->FGType.value_or_default() == FGType::OptiFG && !Config::Instance()->FGDisableOverlays.has_value())
|
||||
Config::Instance()->FGDisableOverlays.set_volatile_value(true);
|
||||
|
||||
Reference in New Issue
Block a user