Skip to content

embed Windows PE resources (version info + app icon) - #30

Merged
LyCecilion merged 2 commits into
developfrom
feat/windows-pe-resource
Aug 4, 2026
Merged

embed Windows PE resources (version info + app icon)#30
LyCecilion merged 2 commits into
developfrom
feat/windows-pe-resource

Conversation

@LyCecilion

Copy link
Copy Markdown
Owner

Embed a PE resource section into Windows builds via the winresource build dependency: version info (FileVersion/ProductVersion auto-derived from Cargo.toml; CompanyName "Project Hazelita", FileDescription "CLI client for Ret2Shell CTF Platform", Comments "YUME∞MITA" via [package.metadata.winresource]) and the application icon.

Add assets/icon.ico (converted from assets/icon.png, sizes 256/128/64/48/32/16); the set_icon path resolves relative to the package root through the resource compiler's -I//I CARGO_MANIFEST_DIR include.

Keep the version-info language neutral (default 0) so i18n can be added later without reworking the resource.

Check CARGO_CFG_TARGET_OS at build-script runtime instead of cfg!(target_os), so resources are also embedded when cross-compiling from Linux/macOS; emit cargo:rerun-if-changed=assets/icon.ico so icon edits rebuild the resource.

Verified: cargo check, clippy --all-targets -- -D warnings, cargo fmt --all --check, 75 unit tests, cargo package ships both icon files.


据说会使用火的只有人类☝️
因为不怕火 文明才得以发展😤
是不是这个原因呢❓😚
在网络的各个角落每天都有人放火🤗
真是令人发笑呢🤣
只要有火种 之后就只需要看着🚬
提问✋😁
火种燃尽之后会怎么样呢😉
三3️⃣
二2️⃣
一1️⃣
时间到⏰⚡
正确答案是⭕📄
周围会燃烧起来🔥🔥🔥
像朋友 家人👪
那个 叫什么来着 新组建的🤔
对了😮
MewType 什么的🛸💥

Embed a PE resource section into Windows builds via the winresource build dependency: version info (FileVersion/ProductVersion auto-derived from Cargo.toml; CompanyName "Project Hazelita", FileDescription "CLI client for Ret2Shell CTF Platform", Comments "YUME∞MITA" via [package.metadata.winresource]) and the application icon.

Add assets/icon.ico (converted from assets/icon.png, sizes 256/128/64/48/32/16); the set_icon path resolves relative to the package root through the resource compiler's -I//I CARGO_MANIFEST_DIR include.

Keep the version-info language neutral (default 0) so i18n can be added later without reworking the resource.

Check CARGO_CFG_TARGET_OS at build-script runtime instead of cfg!(target_os), so resources are also embedded when cross-compiling from Linux/macOS; emit cargo:rerun-if-changed=assets/icon.ico so icon edits rebuild the resource.

Verified: cargo check, clippy --all-targets -- -D warnings, cargo fmt --all --check, 75 unit tests, cargo package ships both icon files.
@LyCecilion LyCecilion added the enhancement New feature or request label Aug 4, 2026
@LyCecilion
LyCecilion merged commit 6f1084c into develop Aug 4, 2026
5 checks passed
@LyCecilion
LyCecilion deleted the feat/windows-pe-resource branch August 5, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant