I seem to be running into some problems here, ( http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/file/trunk/icon.py )
If I call CopyIcons_FromIco() or CopyIcons() using an .ico as source, the python script runs with no errors, it adds the icon to the exe but breaks the exe, i then get the error message "*** is not a valid win32 application" when i try run the exe in question. when using a compiled resource as the source, i get hsrc = win32api.LoadLibraryEx (srcpath, 0, LOAD_LIBRARY_AS_DATAFILE) error: (193, 'LoadLibraryEx', '%1 is not a valid Win32 application.') when running the python script. Am i doing something wrong? I am using python 2.4.3 pywin32 build 208, running on WinXP pro. Thanks, Graeme On 5/3/06, Graeme Glass <[EMAIL PROTECTED]> wrote: > Great, thanks to the both of you, very helpful!! > I had found a interim work around, (not programmable, using GoRC and > Resource Hacker) and so was not happy with it, this is of great help, > thank you. > Graeme > > On 5/3/06, Ralf Schmitt <[EMAIL PROTECTED]> wrote: > > Mark Hammond schrieb: > > >> Does anyone know of a way to add an icon to an existing .exe file on > > >> win32 platform using win32all package? > > > > > > With some pain :( You need to put together the .ico structure yourself > > > and > > > use the BeginUpdateResource() etc win32 functions. The only working code > > > I > > > know (off the top of my head) is in py2exe - and sadly that implements it > > > in > > > C. However, if you understand C it should be possible to port to pure > > > pywin32. > > > > > > > pyinstaller (http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/wiki) has > > pure python code to set icons. Here is a link to the relevant file: > > http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/file/trunk/icon.py > > > > - Ralf > > > > > _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32