Skip to content

ayangweb/tauri-plugin-windows-version

Repository files navigation

tauri-plugin-windows-version

This plugin only works on tauri v2, if you need the v1 plugin, feel free to submit a PR!

Get the version number of the current Windows OS.

Install

cargo add tauri-plugin-windows-version

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

pnpm add tauri-plugin-windows-version-api

Usage

src-tauri/src/lib.rs

pub fn run() {
    tauri::Builder::default()
+       .plugin(tauri_plugin_windows_version::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

src-tauri/capabilities/default.json

{
    ...
    "permissions": [
        ...
+       "windows-version:default"
    ]
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { getWindowsVersion } from "tauri-plugin-windows-version-api";

const version = await getWindowsVersion();
console.log(version); // 11

Methods

Method Description
getWindowsVersion Get the version number of the current Windows OS.
isWindows7 Check if the current OS is Windows 7.
isWindows8 Check if the current OS is Windows 8.
isWindows10 Check if the current OS is Windows 10.
isWindows11 Check if the current OS is Windows 11.

Example

git clone https://github.com/ayangweb/tauri-plugin-windows-version.git
pnpm install

pnpm build

cd examples/tauri-app

pnpm install

pnpm tauri dev

Thanks

Who's Use It

  • Coco AI - Search, Connect, Collaborate, Your Personal AI Search and Assistant, all in one space.

About

Get the version number of the current Windows OS.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy