Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we check if the current OS is win8 or blue

Win8.1 and Win8 has the same OS Version. How can we check if the current OS is Win8 or Blue? The Environment.OSVersion is giving us the same results:

Environment.OSVersion 6.2.9200.0 Environment.OSVersion.Version 6.2.9200.0 Environment.OSVersion.Version.Major 6 Environment.OSVersion.Version.Minor 2

like image 273
Khaleel Hmoz Avatar asked Jul 01 '13 14:07

Khaleel Hmoz


2 Answers

Windows 8.1 will lie to you and tell you it is Window 8. Changing that lie requires editing the manifest that is embedded in your program so that Windows knows you don't want to be lied to. Project + Add New Item, select the Application Manifest File item template. Copy paste this verbiage underneath the <application> element:

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> 
    <application> 
        <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
    </application> 
</compatibility>
like image 148
Hans Passant Avatar answered Nov 19 '22 08:11

Hans Passant


I found a solution under this Registry Key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
like image 30
Khaleel Hmoz Avatar answered Nov 19 '22 09:11

Khaleel Hmoz