3 unstable releases

0.1.1 Apr 12, 2024
0.1.0 Nov 15, 2023
0.0.0 Mar 7, 2023

#68 in Windows APIs

Download history 26358/week @ 2024-07-24 23589/week @ 2024-07-31 27377/week @ 2024-08-07 23600/week @ 2024-08-14 27256/week @ 2024-08-21 27740/week @ 2024-08-28 28258/week @ 2024-09-04 25156/week @ 2024-09-11 23476/week @ 2024-09-18 27681/week @ 2024-09-25 31124/week @ 2024-10-02 31359/week @ 2024-10-09 31646/week @ 2024-10-16 29555/week @ 2024-10-23 33461/week @ 2024-10-30 34038/week @ 2024-11-06

134,402 downloads per month
Used in 391 crates (11 directly)

MIT/Apache

12KB
168 lines

Windows version information

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.")
    }
}

lib.rs:

Learn more about Rust for Windows here: https://github.com/microsoft/windows-rs

Dependencies

~0–4.5MB