3 unstable releases

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

#117 in Windows APIs

Download history 4708/week @ 2023-12-23 5905/week @ 2023-12-30 6799/week @ 2024-01-06 8443/week @ 2024-01-13 7790/week @ 2024-01-20 8589/week @ 2024-01-27 8564/week @ 2024-02-03 9807/week @ 2024-02-10 13685/week @ 2024-02-17 14350/week @ 2024-02-24 15155/week @ 2024-03-02 15115/week @ 2024-03-09 15577/week @ 2024-03-16 17495/week @ 2024-03-23 15375/week @ 2024-03-30 15791/week @ 2024-04-06

66,339 downloads per month
Used in 278 crates (9 directly)

MIT/Apache

14KB
178 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–6MB