6 releases
0.1.6 | Jan 27, 2024 |
---|---|
0.1.5 | Jan 27, 2024 |
#47 in macOS and iOS APIs
35 downloads per month
Used in editres_cli
10MB
80K
SLoC
editres
Embed data into executables after build.
Supported Executable Formats
- Windows (PE)
- Linux (ELF)
- macOS (Mach-O)
Quick Start
1. Declare resources using editres::resource!
use editres::resource;
use std::str::from_utf8;
# fn main() {
let res = resource!("my_res"); // Option<&'static [u8]>
if let Some(res) = res {
println!("{}", from_utf8(res).unwrap());
} else {
println!("my_res is not injected yet");
}
# }
2. Inject data in the executable
You can inject data in executables using library editres
or command line from editres_cli
.
- Library usage:
- Add
editres
as a dependency with featureinjector
enabled, - Refer to
injector::inject
.
- Add
- Command line usage:
cargo install editres_cli
, or download from the releases.- Get command line help using
editres help inject
Notes
editres is based on Node.js' single executable application implementation: postject.
Dependencies
~0–20MB
~306K SLoC