I am working on a C++ application. I want to check the version of the OS on which my C++ application is running to take some action. Basically, all I want to check if the OS version is Windows 2019 or not so that I can take some action. I see that we can use the VersionHelpers.h as below
if (IsWindows8OrGreater())
{
printf("Windows8OrGreater\n");
}
if (IsWindows8Point1OrGreater())
{
printf("Windows8Point1OrGreater\n");
}
if (IsWindows10OrGreater())
{
printf("Windows10OrGreater\n");
}
if (IsWindowsServer())
{
printf("Server\n");
}
However, I want to write only one if block to see if the version is windows 2019. Is there any way to do so?