Skip to main content

Crate windows_version

Crate windows_version 

Source
Expand description

§windows-version

Windows version information without application-manifest version virtualization. Prefer capability detection when an API offers it; use version checks for documented build requirements.

§Get started

[dependencies]
windows-version = "0.101"
use windows_version::OsVersion;

const REQUIRED: OsVersion = OsVersion::new(10, 0, 0, 22_000);

println!("Current version: {:?}", OsVersion::current());
if OsVersion::current() >= REQUIRED {
    println!("The required OS build is available.");
}

§Make a version decision

Keep the threshold beside the feature it guards. OsVersion compares major version, minor version, service pack, and build in that order. A sufficient version does not guarantee optional components, drivers, hardware, or policies; check those capabilities separately.

Structs§

OsVersion
Operating system version information.

Functions§

is_server
Determines if the currently running operating system is a Windows Server release.
revision
Gets the revision number of the operating system.