icon not appearing on executable on 1.4

3,617 views
Skip to first unread message

Peter

unread,
Apr 13, 2010, 11:46:21 AM4/13/10
to PyInstaller
I'm running pyinstaller 1.4 with python 2.5 on Windows XP. I've also
got UPX installed. I can make functioning executables, but now I'm
trying to replace the default icon, but it's not working. Using
ImageMagick, I converted a 32x32 png to an ico file, and then modified
my spec file to include the icon file. Here's my spec file:

# -*- mode: python -*-
a = Analysis([os.path.join(HOMEPATH,'support\\_mountzlib.py'),
os.path.join(HOMEPATH,'support\\useUnicode.py'), 'makeisogui.py'],
pathex=['V:\\pythonstuff'])
a.datas += [('mkisofs.exe', 'v:/pythonstuff/fdu/mkisofs.exe','DATA'),
('isolinux/initrd.img','v:/pythonstuff/fdu/isolinux/
initrd.img','DATA'),
('isolinux/isolinux.bin','v:/pythonstuff/fdu/isolinux/
isolinux.bin','DATA'),
('isolinux/isolinux.cfg','v:/pythonstuff/fdu/isolinux/
isolinux.cfg','DATA'),
('isolinux/vmlinuz','v:/pythonstuff/fdu/isolinux/vmlinuz','DATA'),
('isolinux/vesamenu.c32','v:/pythonstuff/fdu/isolinux/
vesamenu.c32','DATA'),
('isolinux/vsi_grub.jpg','v:/pythonstuff/fdu/isolinux/
vsi_grub.jpg','DATA')]
pyz = PYZ(a.pure)
exe = EXE( pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name=os.path.join('dist', 'makeisogui.exe'),
debug=False,
strip=False,
upx=True,
console=False,
icon='makeiso5.ico' )

The icon file is in the current directory, same as the spec file, when
I run Build.py. The resulting executable works, it just doesn't use
my icon. Windows correctly displays the icon when I see it listed in
the file manager. This seems similar to the bug that existed in 1.3
and was fixed in 1.4, fwiw. Any ideas?

Peter

Giovanni Bajo

unread,
Apr 15, 2010, 6:44:36 PM4/15/10
to pyins...@googlegroups.com
Try with an .ico file that supports multiple resolutions. I know that it
should not be needed, but I think it currently is. I should eventually drop
the lame default icon which is causing these problems.
--
Giovanni Bajo :: ra...@develer.com
Develer S.r.l. :: http://www.develer.com

My Blog: http://giovanni.bajo.it

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To post to this group, send email to pyins...@googlegroups.com.
To unsubscribe from this group, send email to pyinstaller...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyinstaller?hl=en.

Peter Scheie

unread,
Apr 16, 2010, 4:23:42 PM4/16/10
to pyins...@googlegroups.com
I made a 32x32 png file of the original 192x192 image I want for the icon, along with a 64x64, a 128x128, and a 256x256.  Then I put those four images into an .ico file using imagemagick's convert command, as described at http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=14080.  Then, I specified that icon file in my spec file and generated a new executable.  And...I still just get the default pyinstaller icon rather than my icon.  Sigh.  I don't think it's relevant, but the four png files add up to about 73K, but the resulting icon file from 'convert' is 359k!  That's a lot of overhead.

I tried setting Debug=True, but that only applies to the runtime executable, not the build stage.  Is there any other way to see why it's not taking the icon?

mac9416

unread,
Apr 16, 2010, 4:34:24 PM4/16/10
to pyins...@googlegroups.com
Peter,

I once had the same problem. I installed pywin32 and it worked fine.
I'm not sure if that's your problem, but it's worth trying.

-mac

Peter Scheie

unread,
Apr 16, 2010, 5:43:22 PM4/16/10
to pyins...@googlegroups.com
Funny you should mention that.  I'm running Win XP under VirtualBox both at home and at work.  At home I cannot get pywin32 to install, I keep getting a "Access denied.  Cannot open archive." error when I try to run the installer program, whether I run it as myself (with admin privileges) or as Administrator.  At work I already have pywin32 installed, but on both machines I'm having the icon problem.  However, I haven't tried building with the multi-image icon on the machine at work which has pywin32, so I'll do that Monday.  (Anyone have any ideas about why pywin32 won't install?  I posted a message to the mailing list, but no response so far.)

Peter

Giovanni Bajo

unread,
Apr 16, 2010, 6:58:12 PM4/16/10
to pyins...@googlegroups.com
On Fri, 16 Apr 2010 16:43:22 -0500, Peter Scheie <psc...@gmail.com>
wrote:
> Funny you should mention that. I'm running Win XP under VirtualBox both
at
> home and at work. At home I cannot get pywin32 to install, I keep
getting
> a
> "Access denied. Cannot open archive." error when I try to run the
> installer
> program, whether I run it as myself (with admin privileges) or as
> Administrator. At work I already have pywin32 installed, but on both
> machines I'm having the icon problem. However, I haven't tried building
> with the multi-image icon on the machine at work which has pywin32, so
I'll
> do that Monday. (Anyone have any ideas about why pywin32 won't install?
I
> posted a message to the mailing list, but no response so far.)

It's currently broken on some SF mirrors. Try redownloading it from a
different mirror.

Peter Scheie

unread,
Apr 16, 2010, 10:24:56 PM4/16/10
to pyins...@googlegroups.com
I've tried downloading pywin32 at least six times, including specifying a mirror in Sweden and the US (Florida) but I always get the same thing.  Of course, it could be that I've always gotten broken copies, I suppose.  Do you know of a specific mirror that has a known good copy?

Florian Höch

unread,
Apr 16, 2010, 10:38:48 PM4/16/10
to pyins...@googlegroups.com
Hi,

you can easily verify if your download is corrupt by comparing the hash.
A good copy should have:

Filename: pywin32-214.win32-py2.5.exe
MD5 hash: 09EC5EF23D7A1BAD81B80CF6C00C12A3

HashTab ( http://beeblebrox.org/ ) might be handy for comparing hashes
from Windows Explorer.

Am 17.04.2010 04:24, schrieb Peter Scheie:
> I've tried downloading pywin32 at least six times, including specifying
> a mirror in Sweden and the US (Florida) but I always get the same
> thing. Of course, it could be that I've always gotten broken copies, I
> suppose. Do you know of a specific mirror that has a known good copy?
--
Florian Höch

Peter Scheie

unread,
Apr 18, 2010, 8:52:12 PM4/18/10
to pyins...@googlegroups.com
Problem solved!  I hadn't installed Service Pack 2 on this VM.  Once I did, the pywin32 installer ran normally, no questions about which ID to run under, etc.  Thanks for everyone's help.

Peter

Peter Scheie

unread,
Apr 19, 2010, 5:20:22 PM4/19/10
to pyins...@googlegroups.com
Well, almost solved. pywin32 is installed. Now when I run Build.py, I get "ignoring icon and version resources = platform not capable".  I googled for that error, but only found one mention, in which Giovanni asked if the poster had pywin32 installed, and there was no reply.  In my case, yes, I do have pywin32 installed.  What does this error mean?

Peter

Peter Scheie

unread,
Apr 21, 2010, 9:46:28 AM4/21/10
to pyins...@googlegroups.com
I ran Build.py with the multi-resolution icon on my office system, where py32win was already installed.  It builds, and does not give me the 'platform not capable' error that I get on my home machine, but it's still not using the icon I've specified; I'm still getting the default pyinstaller icon.  Could it be that it doesn't like my icon?  It's only two colors, quite simple. In an earlier incarnation, it was saved in 24-bit color (and it didn't work).  I reduced it to 256 colors (since I'm only using two) to reduce the size, but that does not seem to make any difference.  Presumably the --icon option works under the right circumstances; anyone know what those would be?

Peter

mac9416

unread,
Apr 21, 2010, 9:54:40 PM4/21/10
to pyins...@googlegroups.com
Peter, I don't know if it makes any difference, but I made the icon
with GIMP instead of ImageMagik. Might be worth trying that. Also,
installing pywin32 was the only tweak I had to make to make everything
work.

Peter Scheie

unread,
Apr 22, 2010, 4:58:17 PM4/22/10
to pyins...@googlegroups.com
I took all the files of different resolutions--256, 128, 64, and 32 bit--and using the article at http://egressive.com/tutorial/creating-a-multi-resolution-favicon-including-transparency-with-the-gimp as a guide, I also created a 48 and a 16 bit images, and then combined those all into an icon using GIMP, but I still get just the default icon on my executable.  Noting that the article only mentions needing resolution of 128 bit and lower, I also tried throwing out the 256 bit image, but that didn't make any difference. I noticed that the 48bit & 16bit images, produced by scaling down the 256bit image, are also reduced to 4bpp, whereas the ones from Kolourpaint are 8bpp; might this mixing the resolutions make any difference? Is there any sort of debug I can turn on during Build.py to see why it's not using the icon?

Sebastian Hilbert

unread,
Apr 23, 2010, 2:18:48 AM4/23/10
to pyins...@googlegroups.com
Am Donnerstag 22 April 2010 22:58:17 schrieb Peter Scheie:
> I took all the files of different resolutions--256, 128, 64, and 32
> bit--and using the article at
> http://egressive.com/tutorial/creating-a-multi-resolution-favicon-including
> -transparency-with-the-gimpas a guide, I also created a 48 and a 16 bit
> images, and then combined those
> all into an icon using GIMP, but I still get just the default icon on my
> executable. Noting that the article only mentions needing resolution of
> 128 bit and lower, I also tried throwing out the 256 bit image, but that
> didn't make any difference. I noticed that the 48bit & 16bit images,
> produced by scaling down the 256bit image, are also reduced to 4bpp,
> whereas the ones from Kolourpaint are 8bpp; might this mixing the
> resolutions make any difference? Is there any sort of debug I can turn on
> during Build.py to see why it's not using the icon?

Would it make sense to send you my icon to see it that works? If it does the
problem is with your icon. If not ...

Have you considered clearing the icon cache ? I am not sure it is related but
...

http://smallvoid.com/article/windows-icon-cache.html
> > >>>> pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@g
> > >>>> ooglegroups.com>
> >
> > .
> >
> > >>>> For more options, visit this group at
> > >>>> http://groups.google.com/group/pyinstaller?hl=en.
> > >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "PyInstaller" group.
> > > To post to this group, send email to pyins...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@goog
> > > legroups.com>
> >
> > .
> >
> > > For more options, visit this group at
> > > http://groups.google.com/group/pyinstaller?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "PyInstaller" group.
> > To post to this group, send email to pyins...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@google
> > groups.com> .

Florian Höch

unread,
Apr 23, 2010, 4:48:03 AM4/23/10
to pyins...@googlegroups.com
Another idea, I think that a Windows icon should have atleast 16x16,
32x32 and 48x48 pixel sizes (color depth isn't that important anymore
imho, so it should be enough to include full-color/32-bit icons).
Icon cache could be an issue, I once had a case where only a clearing of
the cache and restart would make the exe show the proper icon. Hasn't
happened ever again since then, though.

Regards

Am 23.04.2010 08:18, schrieb Sebastian Hilbert:
> Am Donnerstag 22 April 2010 22:58:17 schrieb Peter Scheie:
>> I took all the files of different resolutions--256, 128, 64, and 32
>> bit--
>
> Have you considered clearing the icon cache ? I am not sure it is related but
> ...
>
> http://smallvoid.com/article/windows-icon-cache.html
--
Florian Höch

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To post to this group, send email to pyins...@googlegroups.com.

Peter Scheie

unread,
Apr 23, 2010, 2:19:12 PM4/23/10
to pyins...@googlegroups.com
Yes, please send me your icon.  I did try rebooting Windows to see if clearing the icon cache would help, but it did not.  I haven't yet tried the other methods of clearning the cache.

Peter Scheie

unread,
Apr 28, 2010, 8:10:44 AM4/28/10
to pyins...@googlegroups.com
Sebastian graciously sent me his icon which I tried, but that doesn't work either, I still get the default pyinstaller icon.  Nuts.

Peter

Sebastian Hilbert

unread,
Apr 28, 2010, 8:18:31 AM4/28/10
to pyins...@googlegroups.com
Am Mittwoch 28 April 2010 14:10:44 schrieb Peter Scheie:
> Sebastian graciously sent me his icon which I tried, but that doesn't work
> either, I still get the default pyinstaller icon. Nuts.
>
What happens if you delete the pyinstaller icon or replace it with your icon
:-)

Sebastian
> >> > > >>>> i...@googlegroups.com>

Peter Scheie

unread,
Apr 28, 2010, 10:08:21 PM4/28/10
to pyins...@googlegroups.com
Ah, clever idea!   So, I tried that: I found two icon files in c:\pyinstaller\source\windows\, iconw.ico and icon1.ico.  I renamed those and then dropped in two copies of my icon and gave the the names iconw.ico and icon1.ico; then I rebuild my executable...and it still came out with the pyinstaller icon.  I don't know how that's possible since I change the names of the original icon files.  And those were the only icon files I found in c:\pyinstaller.  I even tried copying in Sebastion's icon into c:\pyinstaller\source\windows\, naming the files iconw.ico and icon1.ico again; and again, when I run Build.py, I get the default pyinstaller icon.  I tried it with an icon file specified in my spec file and with no icon specified in the spec file; same result.  Since I renamed the original icon files, where is pyinstaller getting the icon from?

Peter

Sebastian Hilbert

unread,
Apr 29, 2010, 2:12:42 AM4/29/10
to pyins...@googlegroups.com
Am Donnerstag 29 April 2010 04:08:21 schrieb Peter Scheie:
> Ah, clever idea! So, I tried that: I found two icon files in
> c:\pyinstaller\source\windows\, iconw.ico and icon1.ico. I renamed those
> and then dropped in two copies of my icon and gave the the names iconw.ico
> and icon1.ico; then I rebuild my executable...and it still came out with
> the pyinstaller icon. I don't know how that's possible since I change the
> names of the original icon files. And those were the only icon files I
> found in c:\pyinstaller. I even tried copying in Sebastion's icon into
> c:\pyinstaller\source\windows\, naming the files iconw.ico and icon1.ico
> again; and again, when I run Build.py, I get the default pyinstaller icon.
> I tried it with an icon file specified in my spec file and with no icon
> specified in the spec file; same result. Since I renamed the original icon
> files, where is pyinstaller getting the icon from?

Just guessing but pyinstaller might be getting the icon from inline python.

We used to do that for GNUmed. There is a feature called py2ico or the other
way around where it would produce python code from an icon and one can use
that in python code.

I guess the next step i would do is to have a look at the code of pyinstaller
, try to identify where it does its icon magic.

I am a beginner at python but
http://www.pyinstaller.org/browser/trunk/Build.py

has

class EXE(Target):
627 typ = 'EXECUTABLE'
628 exclude_binaries = 0
629 append_pkg = 1
630 def __init__(self, *args, **kws):
631 Target.__init__(self)
632 self.console = kws.get('console',1)
633 self.debug = kws.get('debug',0)
634 self.name = kws.get('name',None)
635 self.icon = kws.get('icon',None)

I would throw in a

print self.icon there to see what that yields. If it is None then something is
borked.

then there is

def check_guts(self, last_build):
677 if not os.path.exists(self.name):
678 print "rebuilding %s because %s missing" % (self.outnm,
os.path.basename(self.name))
679 return 1
680 if not self.append_pkg and not os.path.exists(self.pkgname):
681 print "rebuilding because %s missing" % (
682 os.path.basename(self.pkgname),)
683 return 1
684
685 data = Target.get_guts(self, last_build)
686 if not data:
687 return True
688
689 icon, versrsrc = data[3:5]
690 if (icon or versrsrc) and not config['hasRsrcUpdate']:
691 # todo: really ignore :-)
692 print "ignoring icon and version resources = platform not
capable"

One could have a look at the value of icon there

Here it gets interesting:
def assemble(self):
723 print "building EXE from", os.path.basename(self.out)
724 trash = []
725 if not os.path.exists(os.path.dirname(self.name)):
726 os.makedirs(os.path.dirname(self.name))
727 outf = open(self.name, 'wb')
728 exe = self._bootloader_postfix('support/loader/run')
729 exe = os.path.join(HOMEPATH, exe)
730 if target_iswin or cygwin:
731 exe = exe + '.exe'
732 if config['hasRsrcUpdate']:
733 if self.icon:
734 tmpnm = tempfile.mktemp()
735 shutil.copy2(exe, tmpnm)
736 os.chmod(tmpnm, 0755)
737 icon.CopyIcons(tmpnm, self.icon)
738 trash.append(tmpnm)
739 exe = tmpnm

what is the value for self.icon ? Looks like there is a function called
icon.CopyIcons which will make use of self.icon.

1139 if config['hasRsrcUpdate']:
1140 import icon, versionInfo

I can only assume that this means icon.py from
http://www.pyinstaller.org/browser/trunk/icon.py

133 def CopyIcons (dstpath, srcpath):
134 import os.path, string
135
136 if type(srcpath) in StringTypes:
137 srcpath = [ srcpath ]

You could check for srcpath I guess to see where it tries to find the icon.

But be aware that all I have written maybe utter crap and I guess Giovanni
could shed some light on this :-)

Sebastian
> > > >> > > >>>> bsc...@googlegroups.com>
> >
> > <pyinstaller%2Bunsubscr
> >
> > > >> > > >>>> i...@googlegroups.com>
> > > >>
> > > >> <pyinstaller%2Bunsubscribe@g
> > > >>
> > > >> > > >>>> ooglegroups.com>
> > > >> > >
> > > >> > > .
> > > >> > >
> > > >> > > >>>> For more options, visit this group at
> > > >> > > >>>> http://groups.google.com/group/pyinstaller?hl=en.
> > > >> > > >
> > > >> > > > --
> > > >> > > > You received this message because you are subscribed to the
> >
> > Google
> >
> > > >> > > > Groups "PyInstaller" group.
> > > >> > > > To post to this group, send email to
> >
> > pyins...@googlegroups.com.
> >
> > > >> > > > To unsubscribe from this group, send email to
> > > >> > > > pyinstaller...@googlegroups.com<pyinstaller%2Bunsubsc
> > > >> > > > ri...@googlegroups.com>
> >
> > <pyinstaller%2Bunsubscribe
> >
> > > >> > > > @googlegroups.com>
> > > >>
> > > >> <pyinstaller%2Bunsubscribe@goog
> > > >>
> > > >> > > > legroups.com>
> > > >> > >
> > > >> > > .
> > > >> > >
> > > >> > > > For more options, visit this group at
> > > >> > > > http://groups.google.com/group/pyinstaller?hl=en.
> > > >> > >
> > > >> > > --
> > > >> > > You received this message because you are subscribed to the
> > > >> > > Google
> > > >>
> > > >> Groups
> > > >>
> > > >> > > "PyInstaller" group.
> > > >> > > To post to this group, send email to
> > > >> > > pyins...@googlegroups.com
> >
> > .
> >
> > > >> > > To unsubscribe from this group, send email to
> > > >> > > pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscri
> > > >> > > b...@googlegroups.com>
> >
> > <pyinstaller%2Bunsubscribe@g
> >
> > > >> > > ooglegroups.com>
> > > >>
> > > >> <pyinstaller%2Bunsubscribe@google
> > > >>
> > > >> > > groups.com> .
> > > >> > > For more options, visit this group at
> > > >> > > http://groups.google.com/group/pyinstaller?hl=en.
> > > >>
> > > >> --
> > > >> You received this message because you are subscribed to the Google
> > > >> Groups "PyInstaller" group.
> > > >> To post to this group, send email to pyins...@googlegroups.com.
> > > >> To unsubscribe from this group, send email to
> > > >> pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@g
> > > >> ooglegroups.com>
> >
> > <pyinstaller%2Bunsubscribe@googl
> >
> > > >> egroups.com> .
> > > >> For more options, visit this group at
> > > >> http://groups.google.com/group/pyinstaller?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "PyInstaller" group.
> > To post to this group, send email to pyins...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@google
> > groups.com> .
> > For more options, visit this group at
> > http://groups.google.com/group/pyinstaller?hl=en.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To post to this group, send email to pyins...@googlegroups.com.

Giovanni Bajo

unread,
Apr 29, 2010, 2:41:15 AM4/29/10
to pyins...@googlegroups.com
On Wed, 28 Apr 2010 21:08:21 -0500, Peter Scheie <psc...@gmail.com>
wrote:
> Ah, clever idea! So, I tried that: I found two icon files in
> c:\pyinstaller\source\windows\, iconw.ico and icon1.ico. I renamed
those
> and then dropped in two copies of my icon and gave the the names
iconw.ico
> and icon1.ico; then I rebuild my executable...and it still came out with
> the
> pyinstaller icon. I don't know how that's possible since I change the
> names
> of the original icon files. And those were the only icon files I found
in
> c:\pyinstaller. I even tried copying in Sebastion's icon into
> c:\pyinstaller\source\windows\, naming the files iconw.ico and icon1.ico
> again; and again, when I run Build.py, I get the default pyinstaller
icon.
> I tried it with an icon file specified in my spec file and with no icon
> specified in the spec file; same result. Since I renamed the original
icon
> files, where is pyinstaller getting the icon from?

The bulk icon is already part of the binary bootloader (see
support/loader/*.exe: they already have icons). The files you deleted would
affect recompilation of the bootloader, which is usually not performed on
Windows.

If you specify an icon with Makespec.py, the icon should be inserted into
the executable, overwriting the bulk one. I have no idea why the process
fails for you.
--
Giovanni Bajo :: ra...@develer.com
Develer S.r.l. :: http://www.develer.com

My Blog: http://giovanni.bajo.it

Peter Scheie

unread,
Apr 29, 2010, 9:53:19 AM4/29/10
to pyins...@googlegroups.com
It appeared to me that Makespec.py just added the line 'icon=icon.ico' to the spec file; does it do more than that?  I have a spec file containing a lot of hand-written lines (for files to be included in the executable).  I ran Makespec with the --icon parameter and generated a new spec file and it appeared that it just added the 'icon=' line, so then I just added that to my hand-written spec file, but the icon part has never worked.  Does running Makespec.py do more than just create the spec file?

Peter

Giovanni Bajo

unread,
Apr 29, 2010, 10:04:55 AM4/29/10
to pyins...@googlegroups.com
On 4/29/2010 3:53 PM, Peter Scheie wrote:
> It appeared to me that Makespec.py just added the line 'icon=icon.ico'
> to the spec file; does it do more than that?

No, that's all. Sebastian's analysys is correct. You would need to debug
why CopyIcons() does not work for you, and you are not providing us with
many more information than "I don't see the icon".

For instance, try downloading a tool that dumps the resources of a
binary, and see what happens when you add the icon.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com

Sebastian Hilbert

unread,
Apr 29, 2010, 10:49:12 AM4/29/10
to pyins...@googlegroups.com
Am Donnerstag 29 April 2010 16:04:55 schrieb Giovanni Bajo:
> On 4/29/2010 3:53 PM, Peter Scheie wrote:
> > It appeared to me that Makespec.py just added the line 'icon=icon.ico'
> > to the spec file; does it do more than that?
>
> No, that's all. Sebastian's analysys is correct. You would need to debug
> why CopyIcons() does not work for you, and you are not providing us with
> many more information than "I don't see the icon".
>
> For instance, try downloading a tool that dumps the resources of a
> binary, and see what happens when you add the icon.

How exactly do you know that the icon is not there ?
I know little about Windows but I believe that there are some tools to
extract icons from exe files.

Have a look which icon is in your exe.

try http://code.google.com/p/gui2exe/ and configure it to build a spec file
for you. It might not build the perfect exe since it will not know all the
hand crafted code but it is good enough to include the icon for you.

Try it and once if works for the icon modify this spec file.

Sebastian

Peter Scheie

unread,
Apr 29, 2010, 12:00:16 PM4/29/10
to pyins...@googlegroups.com
Sorry, I'll try to provide more details than just "I don't see the icon".  Using Anywhere PE Viewer, I looked at the resources of my executable and the only icon in there is the default pyinstaller icon.  So, I looked at Build.py and through trial and error found that the name of my icon is assigned to self.icon at ~line 635 (in the __init__() method) but in the check_guts() method, at around line 685 the line 'data = Target.get_guts(self, last_build)' results in data equaling None, which means icon is never defined within check_guts (but perhaps it doesn't matter there?).  It looks like config['hasRsrcUpdate'] is never true (should it be?) so CopyIcons() never runs and the icon doesn't get pulled in.

I'll keep digging, but I wanted to mention these things in case anything obviously wrong is evident.

Peter

Giovanni Bajo

unread,
Apr 29, 2010, 12:16:35 PM4/29/10
to pyins...@googlegroups.com
On 4/29/2010 6:00 PM, Peter Scheie wrote:
> It looks like config['hasRsrcUpdate'] is
> never true (should it be?) so CopyIcons() never runs and the icon
> doesn't get pulled in.

Yes, it should be true.

Have a look at Configure.py, test_RsrcUpdate(). That's where
config['hasRsrcUpdate'] is set. Try to find out why it is not set to true.

Peter Scheie

unread,
Apr 29, 2010, 12:20:23 PM4/29/10
to pyins...@googlegroups.com
I should add that before I run Build.py, I delete the build directory that Build.py creates, to make sure nothing bad is carrying over from a previous attempt/build.  I am not creating a new spec file each time, just re-running Build.py.  Is that sufficient for a clean build?

Peter Scheie

unread,
Apr 29, 2010, 12:36:20 PM4/29/10
to pyins...@googlegroups.com
Aha! Problem solved!  Configure.py was the key, or the mention of it anyway.  As I was looking at it, I realized I had not re-run Configure.py since I got pywin32 installed (which took me days because my Windows VM didn't have the latest service pack installed).  I re-ran Configure.py, and now the icon appears in and on my executable as desired. Thanks Giovanni and Sebastian for your help & patience.

Uriel Felix

unread,
Jun 4, 2010, 6:48:02 PM6/4/10
to PyInstaller
> Peter

Did you run Configure.py after install pywin32?

That worked for me.
Reply all
Reply to author
Forward
0 new messages