how to implement a function that will return the OS name? detect the environment where the program running on?
win2000/xp/vista/win7 etc...?
Since Delphi XE2 you can use TOSVersion
record. Note, that it is a global record and you cannot create TOSVersion variables.
For example:
lblVersion.Caption := TOSVersion.ToString;
You have few record properties available to use: Minor
, Major
, Build
, Architecture
provided together with Platform
which you can use to make sure that the operating system is Windows.
To compare the current version of the system with defined one, use Check
version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With