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
> >
> > .
> >
> > > >> > >
b...@googlegroups.com>
> >
pyinstaller...@googlegroups.com<pyinstaller%2Bunsubscribe@google