I'm attempting to detect the difference between Windows 7, Windows 8/Windows 8.1, and Windows 10 in my C# application. I'm attempting to determine this by using
HKLM\Software\Microsoft\WindowsNT\CurrentVersion\ProductName
as I can check whether this value contains "Windows 7", "Windows 8", or "Windows 10" reliably.
My question: is the ProductName registry value localized when Windows is using a different language pack? Will this reliably return the above values in English, or does it change based on OS language?
Before I get hammered for not using other methods of determining the operating system that everyone likes to recommend... using OSVersion is out since it does not always return the correct values. Additionally, GetVersion and GetVersionEx are also not an option since they are not recommended after Windows 8.1, they misidentify Windows 10 as Windows 8. The recommended Version Helper functions that are suppose to replace those methods are not available in C#. If anyone knows of another reliable way to determine the difference between those operating systems, please let me know.
Windows 10 企业版(Enterprise) in Chinese:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName = Windows 10 Enterprise
which suggests the value is not localized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With