FillZpp / sys-info-rs

Get system information in Rust.
MIT License
168 stars 57 forks source link

Seems to return invalid windows versions #83

Closed mjarkk closed 3 years ago

mjarkk commented 3 years ago

When i use os_release on Windows 10 it returns 6.2.9200 but when i match this value to the windows version i get Windows 8.
I'm using https://en.wikipedia.org/wiki/Windows_NT#Releases as reference here, am i doing something wrong here or is this incorrect behavior?

This is what winver has to say: image

davidkna commented 3 years ago

This will only work if you add a manifest to you application and target windows 10 (source)

mjarkk commented 3 years ago

So unless i specifically target windows 10 i don't know i use windows 10?
That kinds makes this function useless right?
Maybe the minor version matches the build number but i doubt that.

davidkna commented 3 years ago

Well yes, but adding the manifest isn't that hard.

mjarkk commented 3 years ago

That's not my point here I said this function is useless if you already know you are on windows 10 because that's the only usable info I can use from this internal windows version.
Better said you could also just remove this function because if you add a manifest for windows 10 you already know you are running windows 10.

davidkna commented 3 years ago

You can use a manifest to tell windows that you support windows 10 (and 8.1...), but that shouldn't cause lower versions to become unsupported. The manifest is just an opt-in that tells windows your application won't crash if it reveals it's running 8.1+.

mjarkk commented 3 years ago

Well oke in that case i'm doing something wrong :)