2026-04-12 16:39:15 +08:00
|
|
|
# WFAssoc
|
2022-02-01 10:54:27 +08:00
|
|
|
|
|
|
|
|
**W**indows **F**ile **Assoc**iation Library
|
|
|
|
|
|
|
|
|
|
**Work In Progress**
|
|
|
|
|
|
2026-04-30 21:56:02 +08:00
|
|
|
## Preface
|
|
|
|
|
|
|
|
|
|
The final goal of this repository is making a viable solution for programmer,
|
|
|
|
|
who is familiar with GUI application development on POSIX system
|
|
|
|
|
and want to find a workable way to setup file associations on Windows for their developed software
|
|
|
|
|
without learning too much Win32 knowledge.
|
|
|
|
|
|
|
|
|
|
So considering this premise, this library will NOT assist those professional Windows developer
|
|
|
|
|
for setting up those complex Windows shell functions, such as the interaction with Explorer preview panel,
|
|
|
|
|
or adding extra entries in menu.
|
|
|
|
|
|
|
|
|
|
In brief words, this library only do one thing. Setup and check file associations for your application,
|
|
|
|
|
and make it at least works.
|
|
|
|
|
|
2022-02-01 10:54:27 +08:00
|
|
|
## Introduction
|
|
|
|
|
|
2025-10-15 13:22:53 +08:00
|
|
|
* `wfassoc`: Core Rust library. Rust programmer can directly utilize it.
|
2026-04-19 16:10:04 +08:00
|
|
|
* `wfassoc-cdylib`: A dynamic library exposed for C/C++ and other languages users.
|
|
|
|
|
* `wfassoc-exec`: A executable configuring file assocation according to user given profile and request.
|
2025-10-15 13:22:53 +08:00
|
|
|
|
2025-12-17 22:34:49 +08:00
|
|
|
If you are a programmer who just want to silently set your file associations for user,
|
2026-04-19 16:10:04 +08:00
|
|
|
`wfassoc-exec` would be your best choice.
|
2025-12-17 22:34:49 +08:00
|
|
|
The only thing you need to do is that write a manifest TOML file,
|
2026-04-19 16:10:04 +08:00
|
|
|
and provide it and `wfassoc-exec` with your executable.
|
|
|
|
|
By executing `wfassoc-exec` with this TOML file in your executable,
|
2025-12-17 22:34:49 +08:00
|
|
|
you can simply achieve this goal, by analyse its return value to check whether it success.
|
2025-10-15 13:22:53 +08:00
|
|
|
|
2025-10-18 09:55:08 +08:00
|
|
|
However, if you are prefering that let user decide which file associations should be created,
|
2025-12-17 22:34:49 +08:00
|
|
|
even have an UI displaying all current file associations related with this program (like 7-Zip File Manager does),
|
2026-04-19 16:10:04 +08:00
|
|
|
you can choose `wfassoc-cdylib` as your solution.
|
|
|
|
|
`wfassoc-cdylib` exposes all essential functions for this task.
|
2025-10-15 13:22:53 +08:00
|
|
|
And you can build it with your own program.
|
|
|
|
|
|
|
|
|
|
At last, if all scenarios above can not cover your requirements,
|
|
|
|
|
you can utilize `wfassoc` directly in Rust, change all essential code in your favor,
|
2025-12-17 22:34:49 +08:00
|
|
|
and finally produce the artifact which only works for your requirements.
|
|
|
|
|
|
|
|
|
|
For the usage of these projects, please browse their README respectively.
|