Reputation: 203
I need to change the icon of an already compiled and linked executable from the command line.
I can't do this in the build process, because this is just a tool in my builds and I don't want to recompile it every time I need to use it.
The executable is compiled and linked with an icon as a resource.
Other restriction is that the change must be done from the command line, so this step could be easily integrated in a build process.
Since I mainly use Microsoft compiler and linker, I was wondering if this can be achieved only by using the tools provided in the Microsoft SDK?
Additionally - I know that normally the change of resource would break any Digital Signature, is there a way to preserve the signature (this is only if possible, the change of the icon is more important). Any help will be much appreciated.
P.S: I know about ResourceHacker but it is of no use, because it doesn't have a command line interface.
Upvotes: 0
Views: 167
Reputation: 79021
See the function 'CopyIcon' here:
Basically it boils down do updating the icon resources in the compiled executable using UpdateResource()
Upvotes: 1