windows exe info
A Cargo build script library to
handle inclusion of Windows icons, version information and application
manifests without the use of external .rc files.
Inspired by and using embed_resource.
Use embed_resource when the windres command is not on PATH.
Generic image format conversion requires imagemagick. Imagemagick needs to be in PATH for the conversion functions to work. If imagemagick is not found, the build script will fail.
The only icon format available without imagemagick is .ico.
This crate only works on windows as resource scripts are a windows thing. Linking for web will fail (I have not yet checked linux or macos). Use build_cfg for checking the target being windows. Build_cfg is required for cross architecture compilation.
Features
- build_cfg: use build_cfg to target the correct architecture
- embed_resource: use embed_resource crate for selecting
.rccompiler - icon_ico: basic icon linking
- icon_placeholder: add a placeholder todo icon
- icon_png: png format support using imagemagick
- icon_magick: generic format support using imagemagick
- icon_autodetect: autodetect icon format by file extension and use specific conversion function (ico, png or magick)
- manifest: allow embedding application manifest files in the executable
- versioninfo: allow adding windows version information to the executable
The default features are
embed_resource,icon_ico,icon_placeholderandversioninfo
breaking changes
0.4.0
icon_xxx,icon_svgandicon_xcfall have been replaced byicon_magick- the
manifestfeature is now optional
examples
add this crate to your build-dependencies
In Cargo.toml
# the rest of the [package] section
= "build.rs"
[]
= "0.4.0"
- adding an icon (
.ico) Inbuild.rs
extern crate windows_exe_info;
- adding version information based on cargo's environment variables
In build.rs choose one of these options
extern crate windows_exe_info;
- adding version information manually
In
build.rs
extern crate windows_exe_info;
- embedding a manifest
add the manifest feature
In Cargo.toml
= { = "0.4.0", = ["manifest"]}
In build.rs
extern crate windows_exe_info;