{"id":15013162,"url":"https://github.com/tauri-apps/winres","last_synced_at":"2025-10-06T07:30:26.480Z","repository":{"id":65368168,"uuid":"585482481","full_name":"tauri-apps/winres","owner":"tauri-apps","description":"Create and set windows icons and metadata for executables with a rust build script","archived":false,"fork":true,"pushed_at":"2024-06-05T08:29:01.000Z","size":195,"stargazers_count":11,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T21:06:08.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"mxre/winres","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tauri-apps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-05T09:32:32.000Z","updated_at":"2024-10-03T11:25:06.000Z","dependencies_parsed_at":"2023-02-11T14:35:22.658Z","dependency_job_id":null,"html_url":"https://github.com/tauri-apps/winres","commit_stats":{"total_commits":79,"total_committers":23,"mean_commits":"3.4347826086956523","dds":0.7341772151898734,"last_synced_commit":"7b1d857889690cb9a0f573448a3e3c440d9dec3e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Fwinres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Fwinres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Fwinres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Fwinres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tauri-apps","download_url":"https://codeload.github.com/tauri-apps/winres/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235262648,"owners_count":18961989,"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":[],"created_at":"2024-09-24T19:43:50.420Z","updated_at":"2025-10-06T07:30:21.207Z","avatar_url":"https://github.com/tauri-apps.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tauri-winres\n\nA simple library to facilitate adding [Resources](\u003chttps://en.wikipedia.org/wiki/Resource_(Windows)\u003e) (metainformation and icons) to [Portable Executables](https://en.wikipedia.org/wiki/Portable_Executable).\n\nNote: `tauri-winres` is a fork of [winres](https://github.com/mxre/winres) which no longer works on Rust 1.61 or higher and has been [left unmaintained](https://github.com/mxre/winres/issues/40). This fork completely replaced the resource compiler implementation with the awesome [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) crate for better cross-platform compilation support. This fork was primarily updated and modified for use in [Tauri](https://github.com/tauri-apps/tauri). For a more general-purpose-like fork, which currently sticks closer to upstream, we suggest to also take a look at [winresource](https://github.com/BenjaminRi/winresource).\n\n[Documentation](https://docs.rs/tauri-winres/)\n\n## Toolkit\n\nBefore we begin you need to have the appropriate tools installed.\n\n- `rc.exe` from the [Windows SDK]\n- `windres.exe` and `ar.exe` from [minGW64]\n\n[windows sdk]: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk\n[mingw64]: http://mingw-w64.org\n\nIf you are using Rust with the MSVC ABI you will need the Windows SDK and for the GNU ABI you'll need minGW64.\n\nThe Windows SDK can generally be found in the registry, but minGW64 must be in the $PATH environment.\n\n## Using tauri-winres\n\nFirst, you will need to add a build script to your crate (`build.rs`) by adding it to your crate's `Cargo.toml` file:\n\n```toml\n[package]\n#...\nbuild = \"build.rs\"\n\n[build-dependencies]\ntauri-winres = \"0.1\"\n```\n\nNext, you have to write a build script. A short example is shown below.\n\n```rust\n// build.rs\n\nfn main() {\n  if std::env::var(\"CARGO_CFG_TARGET_OS\").unwrap() == \"windows\" {\n    let mut res = tauri_winres::WindowsResource::new();\n    res.set_icon(\"test.ico\");\n    res.compile().unwrap();\n  }\n}\n```\n\nThat's it. The file `test.ico` should be located in the same directory as `build.rs`. Metainformation (like program version and description) is taken from `Cargo.toml`'s `[package]` section.\n\nNote that support for using this crate on non-Windows platforms is experimental. It is recommended to only use `tauri-winres` on Windows hosts, by using `cfg` as a directive to avoid building `tauri-winres` on unix platforms alltogether.\n\n```toml\n[package]\n#...\nbuild = \"build.rs\"\n\n[target.'cfg(windows)'.build-dependencies]\ntauri-winres = \"0.1\"\n```\n\nNext, you have to write a build script. A short example is shown below.\n\n```rust\n// build.rs\n\n#[cfg(windows)]\nfn main() {\n    let mut res = tauri_winres::WindowsResource::new();\n    res.set_icon(\"test.ico\");\n    res.compile().unwrap();\n}\n\n#[cfg(unix)]\nfn main() {}\n```\n\n## Additional Options\n\nFor added convenience, `tauri-winres` parses `Cargo.toml` for a `package.metadata.tauri-winres` section:\n\n```toml\n[package.metadata.tauri-winres]\nOriginalFilename = \"PROGRAM.EXE\"\nLegalCopyright = \"Copyright © 2016\"\n#...\n```\n\nThis section may contain arbitrary string key-value pairs, to be included in the version info section of the executable/library file.\n\nThe following keys have special meanings and will be shown in the file properties of the Windows Explorer:\n\n`FileDescription`, `ProductName`, `ProductVersion`, `OriginalFilename` and `LegalCopyright`\n\nSee [MSDN] for more details on the version info section of executables/libraries.\n\n[msdn]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx\n\n## About this project\n\nThe [original author](https://github.com/mxre) and maintainers use this crate for their personal projects and although it has been tested in that context, we have no idea if the behaviour is the same everywhere.\n\nTo be brief, we are very much reliant on your bug reports and feature suggestions to make this crate better.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Fwinres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftauri-apps%2Fwinres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Fwinres/lists"}