From 9aa8d25a7250207418f9d08601b482619cfc8cc1 Mon Sep 17 00:00:00 2001 From: nepnep Date: Wed, 5 Apr 2023 22:43:12 -0400 Subject: [PATCH] fixed win11 not being properly detected (microsoft's fault lol) --- neofetch-win/source.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/neofetch-win/source.cpp b/neofetch-win/source.cpp index 174a62f..4512708 100644 --- a/neofetch-win/source.cpp +++ b/neofetch-win/source.cpp @@ -46,20 +46,26 @@ std::wstring getwinver() { auto car_bomb = key->GetString(L"ProductName"); // don't ask - /*std::wstring ws = key->GetString(L"CurrentBuild"); + bool win11 = true; + + std::wstring ws = key->GetString(L"CurrentBuild"); int buildint = std::stoi(ws); if (buildint > 21999) { - car_bomb = L"Windows 11 " + key->GetString(L"EditionID"); - return car_bomb; + win11 = true; } else { - car_bomb = L"Windows 10 " + key->GetString(L"EditionID"); - return car_bomb; - }*/ + win11 = false; + } + + if (win11 == true) { + car_bomb = L"Windows 11"; + } + else {} return car_bomb; + } catch (const std::exception&) {