views:

326

answers:

1

When I do the following in my setup file,

windows=[
{
'script': 'gulhane.py',
'icon_resources': [(1, "icon.ico")]
}
],

Python crashes and I am unable to run the script using python setup.py py2exe.

So, I do not use the icon_resources field in "windows" but I add the file in the form of a data_file,

data_files=[
('gui', [
'gui/icon.ico'
]
),

I am using Inno Setup to compile the .exe created by py2exe. I try to access this file to add as an icon to the shortcut using,

Name: "{group}\My APP"; Filename: "{app}\MyApp.exe"; WorkingDir: "{app}"; IconFilename: "{app}\gui\icon.ico"

making sure that I keep ChangesAssociations=yes

I am unable to view the icon on the shortcut even after trying this. Could somebody please shed some light on this?

A: 

Hmm... I've never had a problem getting py2exe to put my icon right into the EXE. One possibility: your later example shows the 'icon.ico' file in the 'gui' subdirectory--maybe you need to have that path specified the same in your 'icon_resources' entry? E.g.

...
windows      =  [{
                    'script': 'gulhane.py',
                    'icon_resources': [(1, 'gui/icon.ico')],
                }],
...
ewall