For simplicity, this is declared in the application's manifest, included at link time. Elevation is handled by the platform before it calls .main.
There are ways to conditionally elevate actions, but this is much more complicated to implement. The only thing this tool which doesn't require elevation is --help, so this is much simpler.
cargo can't launch binaries requiring elevation. There's also no way to detect at a build.rs level whether a binary target will be used for a test, and conditionally disable elevation support.
There's no tests in fido-key-manager anyway – so this just disables them explicitly so that a project-wide cargo test won't fail on Windows.
fido-key-manager
requires elevation on Windows:.main
.--help
, so this is much simpler.cargo
can't launch binaries requiring elevation. There's also no way to detect at abuild.rs
level whether a binary target will be used for a test, and conditionally disable elevation support.There's no tests in
fido-key-manager
anyway – so this just disables them explicitly so that a project-widecargo test
won't fail on Windows.