Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#124 some icons won't show on Windows 7

open
nobody
None
7
2012-09-05
2011-03-03
Florian Sening
No

I just realized that the icon for my app disappeared some time ago - it just won't get displayed. But that's not entirely correct - in fact it gets displayed on Windows XP but not on Windows 7. This is really strange because the very same icon (that hasn't changed since the very beginning) would get displayed with older versions of py2exe.

You can easily check out the problem in the py2exe samples. In the advanced sample there is an icon.ico (which is not used right now - uncomment icon_resources to include it) so just build the sample and see for yourself - the icon will get displayed on Windows XP but not on Windows 7.
What's really strange is the fact that there are indeed a few icons that will get displayed correctly on both systems. I haven't been able to figure out the difference between those nevertheless i think this is a bug that must have been introduced somewhere after the 0.5.x versions.

Discussion


  • Anonymous
    2011-09-19

    I had this, it seems that something with py2exe and windows 7 is picky, and editing the .ico file so that the layer order was reversed (larger icons on top in GIMP) made it show up

     
  • kxroberto
    kxroberto
    2012-01-07

    I have the same problem with several icons/programs: Ok on XP, but missing icon on Win7. Several Python2 versions used. (32x32 only icons)

    Its a serious bug. The bug priority should be higher. I guess most progs compiled with 0.6.9 show no proper icon on Win7.

    I found a hot trace: when you create several exe's in a py2exe run at once - either console+windows or multiple windows script->exe's, then only the first created exe has a defect icon, but the last exe has a proper Win7 icon. !?
    So as workaround one could create a dummy (console) .exe in addition to get a proper win exe :-)

    I made a string compare with good vs. bad exe: only 2 bytes differ:

    sg=open(goodexe,'rb').read()
    sb=open(badexe,'rb').read()
    >>> len(sg), len(sb)
    (28672, 28672)
    >>> for i, c in enumerate(sg):
    ... if c != sb[i]:
    ... print i, repr(c), repr(sb[i])
    ...
    20568 '\x01' '\x00'
    27410 '\x01' '\x00'

     
  • kxroberto
    kxroberto
    2012-01-07

    It seems icon resouce ids must be >= 1 on Win7.
    ==> patch 3470667

     
  • Florian Sening
    Florian Sening
    2012-09-05

    • priority: 5 --> 7
     
  • Florian Sening
    Florian Sening
    2012-09-05

    I too think that this is a serious bug so I changed the priority to 7. It seems that this bug has been already fixed in source but I can't confirm this because I'm unable to build py2exe by myself.
    How did you get your workaround to work? Maybe this would help.

     
  • kxroberto
    kxroberto
    2012-09-05

    I built it (py26). Just a MingW C-Compiler (or VC8) is required in addition to Python I think.
    The patch is against 0.6.9

     

  • Anonymous
    2013-02-05

    If I run the setup back to back the icon will show up.