{"id":29068853,"url":"https://github.com/aspectron/winres-edit","last_synced_at":"2025-07-14T22:33:35.311Z","repository":{"id":64860456,"uuid":"575293310","full_name":"aspectron/winres-edit","owner":"aspectron","description":"Windows Resource Editor","archived":false,"fork":false,"pushed_at":"2023-03-20T02:22:14.000Z","size":84,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-27T11:09:32.498Z","etag":null,"topics":["resources","windows"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspectron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-07T07:23:03.000Z","updated_at":"2024-05-19T14:27:30.000Z","dependencies_parsed_at":"2025-06-27T11:09:33.882Z","dependency_job_id":"fcc96a70-1863-47c9-acb6-dabc57b870cf","html_url":"https://github.com/aspectron/winres-edit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aspectron/winres-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fwinres-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fwinres-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fwinres-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fwinres-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspectron","download_url":"https://codeload.github.com/aspectron/winres-edit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fwinres-edit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265360586,"owners_count":23752744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["resources","windows"],"created_at":"2025-06-27T11:09:29.613Z","updated_at":"2025-07-14T22:33:35.253Z","avatar_url":"https://github.com/aspectron.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `winres-edit`\n\nCrate for modification of windows resources.\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-aspectron/winres--edit-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026color=8da0cb\u0026logo=github\" height=\"20\"\u003e](https://github.com/aspectron/winres-edit)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/winres-edit.svg?maxAge=2592000\u0026style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/winres-edit)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-winres--edit-56c2a5?maxAge=2592000\u0026style=for-the-badge\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/winres-edit)\n\u003cimg alt=\"license\" src=\"https://img.shields.io/crates/l/winres-edit.svg?maxAge=2592000\u0026color=6ac\u0026style=for-the-badge\u0026logoColor=fff\" height=\"20\"\u003e\n\n### Overview\n\nThis 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\u003cu8\u003e` data, useful to modify bitmaps and icons.\n\nPlease note that all operations performed on the opened resource file are accumulated and are then \"flushed\" to the file when the file is closed\nusing the `close()` function. This is due to the behavior of the underlying Win32 API ([UpdateResource](https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-updateresourcea)) functionality used by this crate.\n\n### Example\n\n#### Modifying icon data and resource strings\n```rust\nlet mut resources = Resources::new(\u0026Path::new(\"myfile.exe\"));\nresources.load().expect(\"Unable to load resources\");\nresources.open().expect(\"Unable to open resource file for updates\");\n\nresources.find(resource_type::ICON,Id::Integer(1))\n    .expect(\"unable to find main icon\")\n    .replace(icon_data)?\n    .update()?;\n\nlet version: [u16;4] = [0,1,0,0];\nresources.get_version_info()?.expect(\"Unable to get version info\")\n    .set_file_version(\u0026version)\n    .set_product_version(\u0026version)\n    .insert_strings(\n        \u0026[\n            (\"ProductName\",\"My Product\")\n            (\"FileDescription\",\"My File\")\n        ]\n    )\n    .remove_string(\"SomeExistingString\")\n    .update()?;\n\n// make sure to explicitly call close() as that flushes all the session changes\nresources.close();\n```\n\n#### Adding a new icon\n```rust\nlet res = Resource::new(\n    \u0026resources,\n    resource_type::ICON.into(),\n    Id::Integer(14).into(),\n    1033,\n    target_icon.data(),\n);\nres.update()?;\n```\n\n### Icons\n\nThis crate works well in conjunction with the [`ico`](https://crates.io/crates/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.\n\n### Example\n\n```rust\nlet iconfile = std::fs::File::open(\"myicon.ico\").unwrap();\nlet icon_dir = ico::IconDir::read(iconfile).unwrap();    \nlet target_icon = icon_dir\n    .entries()\n    .iter()\n    .find(|\u0026e| e.width() == 256)\n    .expect(\"can't find 256x256 icon\");\nlet icon_data = target_icon.data();\n```\n\nThis crate also works well in conjunction with the [`image`](https://crates.io/image) crate that can interact with the [`ico`](https://crates.io/crates/ico) crate to load, resize and and store custom icons within resource files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Fwinres-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspectron%2Fwinres-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Fwinres-edit/lists"}