#windows #resources #icon #version


Load, create and modify windows resources in existing executables (.exe or .res)

3 releases (breaking)

0.2.0 Mar 20, 2023
0.1.0 Dec 20, 2022
0.0.0 Dec 10, 2022

#65 in Windows APIs

Download history 4/week @ 2023-02-12 4/week @ 2023-02-19 1/week @ 2023-02-26 8/week @ 2023-03-05 21/week @ 2023-03-12 32/week @ 2023-03-19 5/week @ 2023-03-26 7/week @ 2023-04-02 13/week @ 2023-04-09 25/week @ 2023-04-16 19/week @ 2023-04-23 1/week @ 2023-04-30 52/week @ 2023-05-07 4/week @ 2023-05-14 4/week @ 2023-05-21 6/week @ 2023-05-28

66 downloads per month

Apache-2.0 OR MIT

933 lines


Crate for modification of windows resources.

github crates.io docs.rs license


This crate allows you to create, load and modify Windows resources inside of .exe and .res files. This crate currently does not support actual resource data destructuring with exception of Version Strings (VS_VERSION_INFO), which is useful to modify application manifests. Loaded resources are available as raw Vec<u8> data, useful to modify bitmaps and icons.

Please note that all operations performed on the opened resource file are accumulated and are then "flushed" to the file when the file is closed using the close() function. This is due to the behavior of the underlying Win32 API (UpdateResource) functionality used by this crate.


Modifying icon data and resource strings

let mut resources = Resources::new(&Path::new("myfile.exe"));
resources.load().expect("Unable to load resources");
resources.open().expect("Unable to open resource file for updates");

    .expect("unable to find main icon")

let version: [u16;4] = [0,1,0,0];
resources.get_version_info()?.expect("Unable to get version info")
            ("ProductName","My Product")
            ("FileDescription","My File")

// make sure to explicitly call close() as that flushes all the session changes

Adding a new icon

let res = Resource::new(


This crate works well in conjunction with the ico crate that can be used to load/store external .ico files as well as load .png files and encode them into windows-compatible resource format.


let iconfile = std::fs::File::open("myicon.ico").unwrap();
let icon_dir = ico::IconDir::read(iconfile).unwrap();    
let target_icon = icon_dir
    .find(|&e| e.width() == 256)
    .expect("can't find 256x256 icon");
let icon_data = target_icon.data();

This crate also works well in conjunction with the image crate that can interact with the ico crate to load, resize and and store custom icons within resource files.


~3M SLoC