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,7 +4215,9 @@ 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)
{
if (osvi.wSuiteMask & VER_SUITE_PERSONAL)
{ {
res += " Home Edition"; res += " Home Edition";
} }
@ -4212,6 +4226,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
res += " Professional"; res += " Professional";
} }
} }
}
// Test for the server type. // Test for the server type.
@ -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)
{ {