Comment Re:How badly coded are Windows applications? (Score 1) 349
No.... this really comes down to not knowing, and not using, the API provided to you by the OS for handling version detection.
Almost all of the results in the search are Java applications. Java doesn't provide access to the specified API. The only way you can do it is with System.getProperty("os.name") and System.getProperty("os.version") which both return strings.
This is exactly why all modern Javascript libraries do feature detection instead of relying on User-Agent strings.
The code that turns up in most of the search results is trying to determine the correct executable and arguments to execute a command line (i.e. it picks the right one of "sh -c", "command.com