There’s code floating around the forum to do it.
However, you won’t be able to discern Windows 8, 8.1, and 10 without editing the manifest or using plugins.
If you have MBS Complete, there is a class that reports the system for all OSes, and I remember it makes the difference between 8, 8.1 and 10. Forgot the name. Christian will probably chime in.
There is also usually a shell command, like Ver for Windows or sw_vers for Mac.
or define a global dynamic constant and set the Windows instance to Windows, etc
you can even then set it to specific values for specific languages you support