mirror of https://github.com/Icinga/icinga2.git
parent
f13460a2dd
commit
1c7d6895bd
|
@ -42,6 +42,9 @@
|
|||
#ifdef __linux__
|
||||
#include <sys/prctl.h>
|
||||
#endif /* __linux__ */
|
||||
#ifdef _WIN32
|
||||
#include <VersionHelpers.h>
|
||||
#endif /*_WIN32*/
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
@ -538,6 +541,29 @@ int ReleaseHelper(std::string &result)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
static String WindowsVersionHelper()
|
||||
{
|
||||
//Minimum required Version, the installer/user is in the responsibility to take care of that
|
||||
String winver = "Windows Vista";
|
||||
if (IsWindowsVistaSP1OrGreater())
|
||||
winver = "Windows Vista SP1";
|
||||
if (IsWindowsVistaSP2OrGreater())
|
||||
winver = "Windows Vista SP2";
|
||||
if (IsWindows7OrGreater())
|
||||
winver = "Windows 7";
|
||||
if (IsWindows7SP1OrGreater())
|
||||
winver = "Windows 7 SP1";
|
||||
if (IsWindows8OrGreater())
|
||||
winver = "Windows 8";
|
||||
if (IsWindows8Point1OrGreater())
|
||||
winver = "Windows 8.1 or greater";
|
||||
if (IsWindowsServer())
|
||||
winver += " (Server)";
|
||||
|
||||
return winver;
|
||||
}
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/**
|
||||
|
@ -567,6 +593,11 @@ void Application::DisplayInfoMessage(std::ostream& os, bool skipVersion)
|
|||
<< " Operating system: " << UnameHelper('s') << "\n"
|
||||
<< " Operating system version: " << UnameHelper('r') << "\n"
|
||||
<< " Architecture: " << UnameHelper('m') << "\n";
|
||||
#else
|
||||
os << "\n"
|
||||
<< "System information:\n"
|
||||
<< " Operating system: Windows\n"
|
||||
<< " Operating system version: " << WindowsVersionHelper() << "\n";
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef __linux__
|
||||
|
|
Loading…
Reference in New Issue