Crates.io | windows-version |
lib.rs | windows-version |
version | |
source | src |
created_at | 2023-03-07 21:48:31.403952+00 |
updated_at | 2025-03-18 14:26:25.423478+00 |
description | Windows version information |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 803972 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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::*;
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.")
}