Crates.io | windows-version |
lib.rs | windows-version |
version | 0.1.1 |
source | src |
created_at | 2023-03-07 21:48:31.403952 |
updated_at | 2024-04-12 18:32:19.130507 |
description | Windows version information |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 803972 |
size | 20,580 |
The windows-version crate provides reliable operating system version information without the need for application manifest files.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-version]
version = "0.1"
Make use of Windows version information as needed:
use windows_version::*;
fn main() {
println!("Current version: {:?}", OsVersion::current());
if is_server() {
println!("Running on a Windows Server release.");
}
if OsVersion::current() >= OsVersion::new(10, 0, 0, 12345) {
println!("Can use a feature available on this version or later.")
}
}