mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1032 (No icon set in main exe file)
This commit is contained in:
parent
ad2715fc8f
commit
5c37760a27
@ -301,6 +301,10 @@ sys.frameworks_dir = os.path.join(os.path.dirname(os.environ['RESOURCEPATH']), '
|
||||
def main():
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
|
||||
sys.argv[1:2] = ['py2app']
|
||||
d = os.path.dirname
|
||||
icon = os.path.abspath('icons/library.icns')
|
||||
if not os.access(icon, os.R_OK):
|
||||
raise Exception('No icon at '+icon)
|
||||
setup(
|
||||
name = APPNAME,
|
||||
app = [scripts['gui'][0]],
|
||||
@ -310,7 +314,7 @@ def main():
|
||||
'optimize' : 2,
|
||||
'dist_dir' : 'build/py2app',
|
||||
'argv_emulation' : True,
|
||||
'iconfile' : 'icons/library.icns',
|
||||
'iconfile' : icon,
|
||||
'frameworks': ['libusb.dylib', 'libunrar.dylib'],
|
||||
'includes' : ['sip', 'pkg_resources', 'PyQt4.QtXml',
|
||||
'PyQt4.QtSvg', 'PyQt4.QtWebKit', 'commands',
|
||||
|
@ -562,6 +562,9 @@ false
|
||||
48596410-DF5A-1E56-D59C-1B1E2F094FCA,Conditions
|
||||
{1 condition}
|
||||
|
||||
48596410-DF5A-1E56-D59C-1B1E2F094FCA,IconPath
|
||||
{<%InstallDir%>\library.ico}
|
||||
|
||||
48596410-DF5A-1E56-D59C-1B1E2F094FCA,ShortcutName
|
||||
<%AppName%>
|
||||
|
||||
@ -785,7 +788,7 @@ DevconStatus
|
||||
{}
|
||||
|
||||
77D1144B-1013-79B5-034B-5D6BDA6B2FD2,IconPath
|
||||
{<%InstallDir%>\lrfviewer<%Ext%>}
|
||||
{<%InstallDir%>\viewer.ico}
|
||||
|
||||
77D1144B-1013-79B5-034B-5D6BDA6B2FD2,InstallForAllUsers
|
||||
Yes
|
||||
@ -1264,6 +1267,9 @@ Finish
|
||||
D86BBA5C-4903-33BA-59F8-4266A3D45896,Conditions
|
||||
{2 conditions}
|
||||
|
||||
D86BBA5C-4903-33BA-59F8-4266A3D45896,IconPath
|
||||
{<%InstallDir%>\library.ico}
|
||||
|
||||
D86BBA5C-4903-33BA-59F8-4266A3D45896,ShortcutDirectory
|
||||
<%QUICK_LAUNCH%>
|
||||
|
||||
@ -1291,6 +1297,9 @@ Typical
|
||||
E32519F3-A540-C8F3-957F-4C1DB5B25DFE,Conditions
|
||||
{2 conditions}
|
||||
|
||||
E32519F3-A540-C8F3-957F-4C1DB5B25DFE,IconPath
|
||||
{<%InstallDir%>\library.ico}
|
||||
|
||||
E32519F3-A540-C8F3-957F-4C1DB5B25DFE,ShortcutName
|
||||
<%AppName%>
|
||||
|
||||
|
@ -22,6 +22,11 @@ sys.path.insert(0, BASE_DIR)
|
||||
from setup import VERSION, APPNAME, entry_points, scripts, basenames
|
||||
sys.path.remove(BASE_DIR)
|
||||
|
||||
ICONS = [os.path.abspath(os.path.join(BASE_DIR, 'icons', i)) for i in ('library.ico', 'viewer.ico')]
|
||||
for icon in ICONS:
|
||||
if not os.access(icon, os.R_OK):
|
||||
raise Exception('No icon at '+icon)
|
||||
|
||||
VERSION = re.sub('[a-z]\d+', '', VERSION)
|
||||
|
||||
PY2EXE_DIR = os.path.join(BASE_DIR, 'build','py2exe')
|
||||
@ -83,6 +88,11 @@ class BuildEXE(py2exe.build_exe.py2exe):
|
||||
f.write(i, i.partition('\\')[-1])
|
||||
f.close()
|
||||
|
||||
print
|
||||
print 'Copying icons'
|
||||
for icon in ICONS:
|
||||
shutil.copyfile(icon, os.path.join(PY2EXE_DIR, os.path.basename(icon)))
|
||||
|
||||
print
|
||||
print 'Adding third party dependencies'
|
||||
print '\tAdding devcon'
|
||||
@ -126,18 +136,17 @@ def main(args=sys.argv):
|
||||
|
||||
console = [dict(dest_base=basenames['console'][i], script=scripts['console'][i])
|
||||
for i in range(len(scripts['console']))]
|
||||
|
||||
setup(
|
||||
cmdclass = {'py2exe': BuildEXE},
|
||||
windows = [
|
||||
{'script' : scripts['gui'][0],
|
||||
'dest_base' : APPNAME,
|
||||
'icon_resources' : [(1, os.path.join(BASE_DIR, 'icons', 'library.ico'))],
|
||||
'icon_resources' : [(1, ICONS[0])],
|
||||
'other_resources' : [BuildEXE.manifest(APPNAME)],
|
||||
},
|
||||
{'script' : scripts['gui'][1],
|
||||
'dest_base' : 'lrfviewer',
|
||||
'icon_resources' : [(1, os.path.join(BASE_DIR, 'icons', 'viewer.ico'))],
|
||||
'icon_resources' : [(1, ICONS[1])],
|
||||
'other_resources' : [BuildEXE.manifest('lrfviewer')],
|
||||
},
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user