Add viewer and editor icons to windows installer

This commit is contained in:
Kovid Goyal 2015-02-16 20:17:13 +05:30
parent 96abc72ed1
commit 5cb5a698ee
2 changed files with 24 additions and 22 deletions

View File

@ -55,6 +55,10 @@
<Directory Id="DesktopFolder" Name="Desktop"/> <Directory Id="DesktopFolder" Name="Desktop"/>
</Directory> </Directory>
<Icon Id="main_icon" SourceFile="{main_icon}"/>
<Icon Id="viewer_icon" SourceFile="{viewer_icon}"/>
<Icon Id="editor_icon" SourceFile="{editor_icon}"/>
<DirectoryRef Id="APPLICATIONFOLDER"> <DirectoryRef Id="APPLICATIONFOLDER">
{app_components} {app_components}
<Component Id="AddToPath" Guid="*"> <Component Id="AddToPath" Guid="*">
@ -132,7 +136,6 @@
</Feature> </Feature>
<!-- Add icon to entry in Add/Remove programs --> <!-- Add icon to entry in Add/Remove programs -->
<Icon Id="main_icon" SourceFile="{main_icon}"/>
<Property Id="ARPPRODUCTICON" Value="main_icon" /> <Property Id="ARPPRODUCTICON" Value="main_icon" />
<Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" /> <Property Id="ARPURLINFOABOUT" Value="http://calibre-ebook.com" />
<Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" /> <Property Id='ARPHELPLINK' Value="http://calibre-ebook.com/help" />

View File

@ -34,26 +34,27 @@ class WixMixIn:
components = self.get_components_from_files() components = self.get_components_from_files()
wxs = template.format( wxs = template.format(
app = __appname__, app=__appname__,
appfolder = 'Calibre2' if is64bit else __appname__, appfolder='Calibre2' if is64bit else __appname__,
version = __version__, version=__version__,
upgrade_code = UPGRADE_CODE, upgrade_code=UPGRADE_CODE,
ProgramFilesFolder = 'ProgramFiles64Folder' if is64bit else 'ProgramFilesFolder', ProgramFilesFolder='ProgramFiles64Folder' if is64bit else 'ProgramFilesFolder',
x64 = ' 64bit' if is64bit else '', x64=' 64bit' if is64bit else '',
minverhuman = MINVERHUMAN, minverhuman=MINVERHUMAN,
minver = '600', minver='600',
fix_wix = '<Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />' if is64bit else '', fix_wix='<Custom Action="OverwriteWixSetDefaultPerMachineFolder" After="WixSetDefaultPerMachineFolder" />' if is64bit else '',
compression = self.opts.msi_compression, compression=self.opts.msi_compression,
app_components = components, app_components=components,
exe_map = self.smap, exe_map=self.smap,
main_icon = self.j(self.src_root, 'icons', 'library.ico'), main_icon=self.j(self.src_root, 'icons', 'library.ico'),
web_icon = self.j(self.src_root, 'icons', 'web.ico'), viewer_icon=self.j(self.src_root, 'icons', 'viewer.ico'),
editor_icon=self.j(self.src_root, 'icons', 'ebook-edit.ico'),
web_icon=self.j(self.src_root, 'icons', 'web.ico'),
) )
template = open(self.j(self.d(__file__), 'en-us.xml'), template = open(self.j(self.d(__file__), 'en-us.xml'),
'rb').read() 'rb').read()
enus = template.format(app=__appname__) enus = template.format(app=__appname__)
enusf = self.j(self.installer_dir, 'en-us.wxl') enusf = self.j(self.installer_dir, 'en-us.wxl')
wxsf = self.j(self.installer_dir, __appname__+'.wxs') wxsf = self.j(self.installer_dir, __appname__+'.wxs')
with open(wxsf, 'wb') as f: with open(wxsf, 'wb') as f:
@ -81,10 +82,10 @@ class WixMixIn:
'-dWixUIBannerBmp='+banner, '-dWixUIBannerBmp='+banner,
'-dWixUIDialogBmp='+dialog] '-dWixUIDialogBmp='+dialog]
cmd.extend([ cmd.extend([
'-sice:ICE60',# No language in dlls warning '-sice:ICE60', # No language in dlls warning
'-sice:ICE61',# Allow upgrading with same version number '-sice:ICE61', # Allow upgrading with same version number
'-sice:ICE40', # Re-install mode overriden '-sice:ICE40', # Re-install mode overriden
'-sice:ICE69', # Shortcut components are part of a different feature than the files they point to '-sice:ICE69', # Shortcut components are part of a different feature than the files they point to
]) ])
if self.opts.no_ice: if self.opts.no_ice:
cmd.append('-sval') cmd.append('-sval')
@ -153,5 +154,3 @@ class WixMixIn:
self.smap[x] = 'file_%d'%self.file_id_map[self.a(self.j(self.base, x+'.exe'))] self.smap[x] = 'file_%d'%self.file_id_map[self.a(self.j(self.base, x+'.exe'))]
return '\t\t\t\t'+'\n\t\t\t\t'.join(components) return '\t\t\t\t'+'\n\t\t\t\t'.join(components)