ENH: fix for Windows Vista

This commit is contained in:
Sebastien Barre 2008-10-15 23:24:33 -04:00
parent b82eb2b9b3
commit ef93279573

View File

@ -4170,6 +4170,18 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
// Test for the specific product family. // Test for the specific product family.
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
{
if (osvi.wProductType == VER_NT_WORKSTATION)
{
res += "Microsoft Windows Vista";
}
else
{
res += "Microsoft Windows Server 2008 family";
}
}
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)
{ {
res += "Microsoft Windows Server 2003 family"; res += "Microsoft Windows Server 2003 family";
@ -4203,13 +4215,16 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
{ {
res += " Workstation 4.0"; res += " Workstation 4.0";
} }
else if (osvi.wSuiteMask & VER_SUITE_PERSONAL) else if (osvi.dwMajorVersion == 5)
{ {
res += " Home Edition"; if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
} {
else res += " Home Edition";
{ }
res += " Professional"; else
{
res += " Professional";
}
} }
} }
@ -4253,7 +4268,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
} }
} }
else // Windows NT 4.0 else if (osvi.dwMajorVersion <= 4) // Windows NT 4.0
{ {
if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE) if (osvi.wSuiteMask & VER_SUITE_ENTERPRISE)
{ {