Embedding icon in .exe with py2exe, visible in Vista?

Posted by WindPower on Stack Overflow See other posts from Stack Overflow or by WindPower
Published on 2009-02-08T07:26:06Z Indexed on 2010/04/18 13:03 UTC
Read the original article Hit count: 650

Filed under:
|
|
|
|

Hello,

I've been trying to embed an icon (.ico) into my "compyled" .exe with py2exe.

Py2Exe does have a way to embed an icon:

windows=[{
    'script':'MyScript.py',
    'icon_resources':[(1,'MyIcon.ico')]
}]

And that's what I am using. The icon shows up fine on Windows XP or lower, but doesn't show at all on Vista. I suppose this is because of the new Vista icon format, which can be in PNG format, up to 256x256 pixels.

So, how can I get py2exe to embed them into my executable, without breaking the icons on Windows XP?

I'm cool with doing it with an external utility rather than py2exe - I've tried this command-line utility to embed it, but it always corrupts my exe and truncates its size for some reason.

© Stack Overflow or respective owner

Related posts about python

Related posts about py2exe