cmdpal-packaging 0.2.1

Buld-time packaging helpers for cmdpal
Documentation
  • Coverage
  • 100%
    19 out of 19 items documented0 out of 18 items with examples
  • Size
  • Source code size: 54.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.75 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • BlueGlassBlock/cmdpal-rs
    9 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • BlueGlassBlock

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