Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'
11–20 of 37 posts
Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'
#12The Windows C/C++ API returns a structure with version numbers [1], same with the C# one [2]. Other languages just wrap the native C API call, GetVersionEx.
The most troubled framework is Java: because of some strange design decision, you can only get the version as a string (see [3]), and that makes impressively easy for programmers to screw up version checks. However, as other commenters have said, those apps could run on compatibility mode and Windows would solve the issue itself instead of completely changing an operating system's name.
1: http://msdn.microsoft.com/en-us/library/windows/desktop/ms72... 2: http://msdn.microsoft.com/en-us/library/system.environment.o... 3: http://stackoverflow.com/questions/228477/how-do-i-programma...
Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'
#13There are no good reasons to check for an OS version anyway. Checking for the platform, ok. Not the version. That can be handled with feature detection.
Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'
#14Earlier quoted context omitted.
This "convulted version checking method" is the default way to do it with Java, I'm not sure if there's any other programming languages that do it as well.
Source for that?
[1] https://searchcode.com/?q=if%28version%2Cstartswith%28%22win...
[2] http://docs.oracle.com/javase/tutorial/essential/environment...
Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'
#15There are no good reasons to check for an OS version anyway. Checking for the platform, ok. Not the version. That can be handled with feature detection.