问题
...id like something I could integrate into my build process: is there anything "standard" tool that does this?
回答1:
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.
回答2:
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!
回答3:
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.
回答4:
Looks like I've found the perfect solution for what I'm trying to do.
来源:https://stackoverflow.com/questions/1207965/is-there-a-command-line-utility-to-change-the-embedded-icon-of-a-win32-exe