proto-reg 0.1.0

Manage custom URL protocols in the Windows registry
docs.rs failed to build proto-reg-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

proto-reg

Manage custom URL protocols in the Windows registry.

Custom URL protocols (schemes such as myapp://) are registered under HKEY_CLASSES_ROOT\<scheme> and handled by shell\open\command entries where %1 is replaced with the URL.

Features

  • query — show details of a registered protocol
  • list — list all registered URL protocols (--json for JSON output)
  • add — register a new protocol or update an existing one
  • remove — delete a protocol from the registry
  • backup — export protocols as JSON (stdout, or a file with -o)
  • restore — restore protocols from a JSON backup file
  • browser-policy — show the "Always open these links" checkbox in the Chrome/Edge external-protocol dialog (enabled by default with add)

Usage

proto-reg add myapp -c "\"C:\Program Files\MyApp\myapp.exe\" \"%1\"" -d "My App"
proto-reg list
proto-reg backup -o protocols.json
proto-reg restore protocols.json
proto-reg browser-policy --remove

Write operations (add, remove, restore, browser-policy) target HKLM\Software\Classes / HKLM\Software\Policies and require an elevated (Administrator) terminal. query, list and backup are read-only.

Library

Also usable as a Rust library:

use proto_reg::{Protocol, ProtocolManager};

let protocol = Protocol::new("myapp", r#""C:\Program Files\MyApp\myapp.exe" "%1""#)?;
ProtocolManager::add(&protocol)?;
ProtocolManager::set_browser_policy(true)?; // show "Always open" checkbox in Chrome/Edge

License

MIT