Live data from Hacker News

Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

searchcode.com

1–10 of 37 posts

Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

#4
post #3

They could have just ran those apps in compatibility mode, which returns different values for all the GetWindowsVersion calls. Or they could rename the entire OS.

There are no APIs that return a string of the product name. GetVersionEx gives you numbers. To screw up in this manner, you have to be relying on at least two layers of broken code on top of the really simple API that you should be using directly.

So I don't buy this rumor at all. The number of real applications that 1) remember Windows 9x exist, 2) aren't completely broken on modern Windows anyway, and 3) go out of their way to use some convoluted version checking method has to be extremely small.

Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

#6
post #4
post #3

They could have just ran those apps in compatibility mode, which returns different values for all the GetWindowsVersion calls. Or they could rename the entire OS.

There are no APIs that return a string of the product name. GetVersionEx gives you numbers. To screw up in this manner, you have to be relying on at least two layers of broken code on top of the really simple API that you should be using directly. So I don't buy this rumor at all. The number of real applications that 1) remember Windows 9x exist, 2) aren't completely broken on modern Windows anyway, and 3) go out of…

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.

Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

#7
post #4

Earlier quoted context omitted.

There are no APIs that return a string of the product name. GetVersionEx gives you numbers. To screw up in this manner, you have to be relying on at least two layers of broken code on top of the really simple API that you should be using directly. So I don't buy this rumor at all. The number of real applications that 1) remember Windows 9x exist, 2) aren't completely broken on modern Windows anyway, and 3) go out of…

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?

Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

#8
post #3

They could have just ran those apps in compatibility mode, which returns different values for all the GetWindowsVersion calls. Or they could rename the entire OS.

I would go with renaming the entire OS. Let it be FAOSDSACH, as in Formerly Awesome Operating System Destroyed by Suits And Corporate Heads

Re: Windows 10: Code that uses 'os.StartsWith(“Windows 9”)'

#9

Earlier 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?

System.getProperty("os.name")
Post reply on HN