Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(win): embed a manifest to allow using kanata in elevated windows #946

Merged
merged 8 commits into from
Apr 20, 2024

Conversation

eugenesvk
Copy link
Contributor

Describe your changes. Use imperative present tense.

Add a manifest to the kanata.exe Windows binary so that external tools can overwrite it to make it work in elevated contexts. This manifest doesn't have uia enabled on its own as this doesn't work with an unsigned binary

So I've also added AutoHotkey scripts that sign the binary (and enable uia). Can also add a "compiled" EnableUIAccess.exe file to make it simpler and not require AHK installs if you want

Checklist

  • Add documentation to docs/config.adoc
    • Yes or N/A
  • Add example and basic docs to cfg_samples/kanata.kbd
    • n/a
  • Update error messages
    • n/a
  • Added tests, or did manual testing
    • Yes manual

partially addresses #831. Fully addressing that would require adding some Windows installer that could self-sign kanata (or sign with a proper $ certificate) and add it to Program Files

@jtroo
Copy link
Owner

jtroo commented Apr 17, 2024

Thanks!

(work in elevated windows on Windows)

requires a self-signed binary (currently via an external AutoHotkey app) that can then change the manifest to have uiAccess="true"
jtroo added 3 commits April 17, 2024 23:07
This is done because this change adds 30 new crates which need to be
downloaded and compiled. It seems wasteful to do this unless explicitly
opted into, which can be done for those that desire it and for official
builds.

Additionally, the number of `cfg` declarations is minimized in build.rs
by declaring an in-file module.
@jtroo jtroo merged commit c61a208 into jtroo:main Apr 20, 2024
4 checks passed
@eugenesvk eugenesvk deleted the win_manifest branch April 21, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants