7 ms·
Is the Windows version ever exposed as a string in the Windows API? Seems strange in my mind, but I have no experience with Windows. On the one hand it sounds l
by fantyoon 3y ago
Is the Windows version ever exposed as a string in the Windows API? Seems strange in my mind, but I have no experience with Windows. On the one hand it sounds like something Microsoft would do for backwards compatibility, but on the other hand it seems like a weird API to provide.
I found GetVersion[1] but that returns the version as two numbers.
[1] https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversion https://learn.microsoft.com/en-us/windows/win32/api/sysinfoa...
- IshKebab 3y agoYou're imagining that all developers do things properly. I've seen Bash code that used a regex to get the first two digits from `python --version`. Hopefully they'll never release a Python 3.10!
- Phrodo_00 3y agoI don't know if the rumor is true, but even if Windows itself doesn't provide an API that looks like that (I also looked around real quick and didn't find anything), it's not unreasonable that there could be libraries that provide the version that way.
- TheRealSteel 3y agoThe rumour is not true, despite reddit's insistence. Windows exposes it's version is a series of numbers, and even if it didn't, Windows 9 could have returned "Windows Nine", "Window v9" or loads of other things.
- deleted 3y ago[deleted]