I'm trying in vain to set the icon for the executable generated
by py2exe. According to various sources there are two answers:
1) Do it on the command line:
python setup.py py2exe --icon foo.ico
That generates a usage error:
error: --icon not recognized
2) According to http://starship.python.net/crew/thel...gi/CustomIcons
you can set the icon_resources in the setup.py like this:
# setup.py
from distutils.core import setup
import py2exe
setup(windows=[{"script":"vfcu pdate.py","icon _resources":[(1,"rivatek.ico ")]}])
That doesn't work either:
running py2exe
[...]
copying C:\Python23\Lib \site-packages\wx\wxm sw251h_html_vc. dll -> C:\cygwin\home\ admin\othertool s\dist
copying C:\Python23\Lib \site-packages\wx\wxb ase251h_vc.dll -> C:\cygwin\home\ admin\othertool s\dist
copying C:\PYTHON23\w9x popen.exe -> C:\cygwin\home\ admin\othertool s\dist
copying C:\WINDOWS\SYST EM\python23.dll -> C:\cygwin\home\ admin\othertool s\dist
copying C:\Python23\Lib \site-packages\py2exe \run_w.exe -> C:\cygwin\home\ admin\othertool s\dist\vfcupdat e.exe
Traceback (most recent call last):
File "setup.py", line 5, in ?
setup(windows=[{"script":"vfcu pdate.py","icon _resources":[(1,"rivatek.ico ")]}])
File "C:\PYTHON23\li b\distutils\cor e.py", line 149, in setup
dist.run_comman ds()
File "C:\PYTHON23\li b\distutils\dis t.py", line 907, in run_commands
self.run_comman d(cmd)
File "C:\PYTHON23\li b\distutils\dis t.py", line 927, in run_command
cmd_obj.run()
File "C:\Python23\Li b\site-packages\py2exe \build_exe.py", line 197, in run
self.create_bin aries(py_files, extensions, dlls)
File "C:\Python23\Li b\site-packages\py2exe \build_exe.py", line 395, in create_binaries
arcname, target.script)
File "C:\Python23\Li b\site-packages\py2exe \build_exe.py", line 577, in build_executabl e
add_icon(unicod e(exe_path), unicode(ico_fil ename), ico_id)
RuntimeError: MapExistingFile : The handle is invalid.
Has anybody really been able to set the icon for the executable
generated by py2exe?
--
Grant Edwards grante Yow! Now I'm concentrating
at on a specific tank battle
visi.com toward the end of World
War II!