Mono .EXE assembly set explorer icon

2019-01-27 11:24发布

问题:

When compiling with gmcs on Linux, how can I set the explorer icon the final EXE will use?

I have a .ico file to attach to the output exe.

The answer must be build-automatable and execute on Linux (w/o wine -- build machine architecture is not x86).

GCC and binutils targeting Windows x86 are available. If you give the answer referring to their short (non-cross) names I'll be able to figure out their cross names easily enough.

回答1:

Looks like it is done the same way as .Net (learned from looking at the output window of a build in Visual Studio):

/win32icon:my.ico

So something like this:

gmcs myprog.cs /win32icon:my.ico