Is there a command line utility to change the embe

2020-07-05 05:23发布

...id like something I could integrate into my build process: is there anything "standard" tool that does this?

标签: windows icons
4条回答
我只想做你的唯一
2楼-- · 2020-07-05 06:04

Have you seen Resource Hacker? You can also drive it via the command line (script) so I'm sure it could be incorporated into your build.

查看更多
可以哭但决不认输i
3楼-- · 2020-07-05 06:21

I am pretty sure Resource Hacker can do this, and some other things, I believe i recognize its icon from when i used it a while back. Hope that helps you!

查看更多
Bombasti
4楼-- · 2020-07-05 06:25

Looks like I've found the perfect solution for what I'm trying to do.

查看更多
闹够了就滚
5楼-- · 2020-07-05 06:26

You need to create a resource script file (.rc), and then compile it to an object file with rc (.rc.res) and cvtres (.res.obj). Both tools are included in the Microsoft Platform SDK. When you include the object file into an linker command, the result will have the icon specified in the resource script file. Here's a sample resource file and the commands to create the object:

resource.rc:

101          ICON                    "my_icon.ico"

Your icon file is in the file my_icon.ico. Commands to compile these into an object file:

rc -fo resource.res resource.rc
cvtres -machine:ix86 -out:resource.obj resource.res

But, by far the easiest way to set the program icon is to just do it in Visual Studio.

Technically, neither will allow you to actually change the icon of an existing executable, but somehow I doubt that's what you really want to do.

查看更多
登录 后发表回答