cmdpal-packaging

Crates.iocmdpal-packaging
lib.rscmdpal-packaging
version0.2.1
created_at2025-06-23 06:46:33.687178+00
updated_at2025-10-25 07:03:16.859614+00
descriptionBuld-time packaging helpers for cmdpal
homepage
repositoryhttps://github.com/BlueGlassBlock/cmdpal-rs
max_upload_size
id1722453
size54,700
Nyuan Zhang (BlueGlassBlock)

documentation

README

cmdpal-packaging

A simple build-script helper crate for cmdpal-rs.

Explanation

Getting your home-baked (using Rust in this case) Command Palette extension to work with Windows is a bit of a hassle.

First, you have to obtain an AppxManifest.xml file to instruct the system to register your COM extension GUIDs, and invoke your server.

At runtime, a Microsoft.CommandPalette.Extensions.winmd binary file is required to make Command Palette program communicate with your extension.

This crate provides helpers to generate the two files.

Usage

To use this crate, add it to your Cargo.toml:

[build-dependencies]
cmdpal-packaging = "0.2"

Then, in your build.rs:

fn main() {
    cmdpal_packaging::generate_winmd().unwrap();
    cmdpal_packaging::AppxManifestBuilder::new()
        .id("YourName.YourExtension")
        .display_name("A Cool Extension")
        .publisher_display_name("CN=xxxxxxxx")
        .class_u128(GUID, None)
        .executable("your_cool_extension.exe")
        .build()
        .write_xml()
        .unwrap();
}

After building, you can run Add-AppxPackage -Path ./AppxManifest.xml -Register in PowerShell, under your extension's target directory, to register your extension and test it out.

If you are getting rust-analyzer warnings, it is likely because the winmd file is occupied when the extension is running. You can safely ignore errors in that case.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Commit count: 5

cargo fmt