Skip to main content

 none
Why does IsWindows10OrGreater require Windows 10 being declared in the manifest? RRS feed

  • Question

  • I get that different environment version methods (like GetVersionEx) had to start lying about the version number, because lots of developers fail at writing version checks. And that to get the real version requires a manifest with the right Guid. So IsWindowsVersionOrGreater was introduced under the promise that it would never lie.

    Now in the Remarks for IsWindows10OrGreater there's the line "Applications not manifested for Windows 10 return false, even if the current operating system version is Windows 10.". Why? Doesn't requiring the manifest completely defeat the purpose of IsWindowsVersionOrGreater and its promise to never lie?


    • Edited by jader3rd Wednesday, May 10, 2017 5:00 PM Adding an example
    Wednesday, May 10, 2017 4:53 PM

All replies

  • Hi,

    Thank you for posting here.

    >>" So IsWindowsVersionOrGreater was introduced under the promise that it would never lie.  "

    Where you find the sentence on MSDN forum?  Based on my search, I didn't find any relevant document explaining it.

    According to the MSDN document, we know that IsWindows10OrGreater method needs manifest file to specify the windows version.

    Here is a part of manifest file.

    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
            <application> 
                <!-- Windows 10 --> 
                <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
                <!-- Windows 8.1 -->
                <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
                <!-- Windows Vista -->
                <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> 
                <!-- Windows 7 -->
                <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
                <!-- Windows 8 -->
                <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
            </application> 
        </compatibility>
    

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, May 12, 2017 6:02 AM
    Moderator
  • I know it needs the manifest file. That's what wrong. When 8.1 came out, to get the version from GetVersionEx, you needed the manifest file. But IsWindowsVersionOrGreater still worked. I can't remember where I read, but I was informed that IsWindowsVersionOrGreater would always work, even without manifest files. The idea being that it correctly solved the reason why developers were using GetVersionEx in the first place. So using it, should have been future proof.

    But it couldn't go more than one release without it working. I want to know why.

    Friday, May 12, 2017 12:54 PM