mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Fix Windows installer to correctly upgrade previous calibre installs
This commit is contained in:
parent
77369380b1
commit
d2618701ec
@ -20,7 +20,6 @@ class LinuxFreeze(Command):
|
|||||||
from cx_Freeze import Executable, setup
|
from cx_Freeze import Executable, setup
|
||||||
from calibre.linux import entry_points
|
from calibre.linux import entry_points
|
||||||
from calibre import walk
|
from calibre import walk
|
||||||
from calibre.web.feeds.recipes import recipe_modules
|
|
||||||
|
|
||||||
is64bit = platform.architecture()[0] == '64bit'
|
is64bit = platform.architecture()[0] == '64bit'
|
||||||
arch = 'x86_64' if is64bit else 'i686'
|
arch = 'x86_64' if is64bit else 'i686'
|
||||||
@ -110,7 +109,6 @@ class LinuxFreeze(Command):
|
|||||||
packages = ['calibre', 'encodings', 'cherrypy', 'cssutils', 'xdg',
|
packages = ['calibre', 'encodings', 'cherrypy', 'cssutils', 'xdg',
|
||||||
'dateutil', 'dns', 'email']
|
'dateutil', 'dns', 'email']
|
||||||
|
|
||||||
includes += ['calibre.web.feeds.recipes.'+r for r in recipe_modules]
|
|
||||||
includes += ['calibre.gui2.convert.'+x.split('/')[-1].rpartition('.')[0] for x in \
|
includes += ['calibre.gui2.convert.'+x.split('/')[-1].rpartition('.')[0] for x in \
|
||||||
glob.glob('src/calibre/gui2/convert/*.py')]
|
glob.glob('src/calibre/gui2/convert/*.py')]
|
||||||
|
|
||||||
|
@ -141,7 +141,9 @@ class Win32Freeze(Command, WixMixIn):
|
|||||||
shutil.copytree(x, self.j(sp_dir, self.b(x)))
|
shutil.copytree(x, self.j(sp_dir, self.b(x)))
|
||||||
|
|
||||||
for x in (r'calibre\manual', r'calibre\trac', 'pythonwin'):
|
for x in (r'calibre\manual', r'calibre\trac', 'pythonwin'):
|
||||||
shutil.rmtree(self.j(sp_dir, x))
|
deld = self.j(sp_dir, x)
|
||||||
|
if os.path.exists(deld):
|
||||||
|
shutil.rmtree(deld)
|
||||||
|
|
||||||
for x in os.walk(self.j(sp_dir, 'calibre')):
|
for x in os.walk(self.j(sp_dir, 'calibre')):
|
||||||
for f in x[-1]:
|
for f in x[-1]:
|
||||||
|
@ -2,14 +2,29 @@
|
|||||||
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
|
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
|
||||||
>
|
>
|
||||||
|
|
||||||
<Product Name='{app}' Id='{product_guid}' UpgradeCode='{upgrade_code}'
|
<Product Name='{app}' Id='*' UpgradeCode='{upgrade_code}'
|
||||||
Language='1033' Codepage='1252' Version='{version}' Manufacturer='Kovid Goyal'>
|
Language='1033' Codepage='1252' Version='{version}' Manufacturer='Kovid Goyal'>
|
||||||
|
|
||||||
<Package Id='*' Keywords='Installer' Description="{app} Installer"
|
<Package Id='*' Keywords='Installer' Description="{app} Installer"
|
||||||
Comments='{app} is a registered trademark of Kovid Goyal' Manufacturer='Kovid Goyal'
|
Comments='{app} is a registered trademark of Kovid Goyal' Manufacturer='Kovid Goyal'
|
||||||
InstallerVersion='300' Languages='1033' Compressed='yes'
|
InstallerVersion='300' Languages='1033' Compressed='yes'
|
||||||
SummaryCodepage='1252' />
|
SummaryCodepage='1252' />
|
||||||
|
|
||||||
<Media Id="1" Cabinet="{app}.cab" CompressionLevel="{compression}" EmbedCab="yes" />
|
<Media Id="1" Cabinet="{app}.cab" CompressionLevel="{compression}" EmbedCab="yes" />
|
||||||
|
|
||||||
|
<Upgrade Id="{upgrade_code}">
|
||||||
|
<UpgradeVersion Maximum="{version}"
|
||||||
|
IncludeMaximum="yes"
|
||||||
|
OnlyDetect="no"
|
||||||
|
Language="1033"
|
||||||
|
Property="OLDPRODUCTFOUND"/>
|
||||||
|
<UpgradeVersion Minimum="{version}"
|
||||||
|
IncludeMinimum="no"
|
||||||
|
OnlyDetect="yes"
|
||||||
|
Language="1033"
|
||||||
|
Property="NEWPRODUCTFOUND"/>
|
||||||
|
</Upgrade>
|
||||||
|
<CustomAction Id="PreventDowngrading" Error="Newer version already installed."/>
|
||||||
|
|
||||||
<Directory Id='TARGETDIR' Name='SourceDir'>
|
<Directory Id='TARGETDIR' Name='SourceDir'>
|
||||||
<Merge Id="VCRedist" SourceFile="{crt_msm}" DiskId="1" Language="0"/>
|
<Merge Id="VCRedist" SourceFile="{crt_msm}" DiskId="1" Language="0"/>
|
||||||
@ -102,7 +117,14 @@
|
|||||||
<Condition
|
<Condition
|
||||||
Message="This application is only supported on Windows XP SP2, or higher.">
|
Message="This application is only supported on Windows XP SP2, or higher.">
|
||||||
<![CDATA[Installed OR (VersionNT >= 501)]]>
|
<![CDATA[Installed OR (VersionNT >= 501)]]>
|
||||||
</Condition>
|
</Condition>
|
||||||
|
<InstallExecuteSequence>
|
||||||
|
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
|
||||||
|
<RemoveExistingProducts Before="InstallInitialize" />
|
||||||
|
</InstallExecuteSequence>
|
||||||
|
<InstallUISequence>
|
||||||
|
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
|
||||||
|
</InstallUISequence>
|
||||||
|
|
||||||
<UI>
|
<UI>
|
||||||
<UIRef Id="WixUI_Advanced" />
|
<UIRef Id="WixUI_Advanced" />
|
||||||
|
@ -6,12 +6,10 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os, uuid, shutil, subprocess
|
import os, shutil, subprocess
|
||||||
|
|
||||||
from setup import __appname__, __version__, basenames
|
from setup import __appname__, __version__, basenames
|
||||||
|
|
||||||
guid = uuid.uuid4 # Random GUID
|
|
||||||
|
|
||||||
WIXP = r'C:\Program Files\Windows Installer XML v3.5'
|
WIXP = r'C:\Program Files\Windows Installer XML v3.5'
|
||||||
CANDLE = WIXP+r'\bin\candle.exe'
|
CANDLE = WIXP+r'\bin\candle.exe'
|
||||||
LIGHT = WIXP+r'\bin\light.exe'
|
LIGHT = WIXP+r'\bin\light.exe'
|
||||||
@ -31,8 +29,7 @@ class WixMixIn:
|
|||||||
wxs = template.format(
|
wxs = template.format(
|
||||||
app = __appname__,
|
app = __appname__,
|
||||||
version = __version__,
|
version = __version__,
|
||||||
product_guid = guid(),
|
upgrade_code = 'BEB2A80D-E902-4DAD-ADF9-8BD2DA42CFE1',
|
||||||
upgrade_code = guid(),
|
|
||||||
compression = self.opts.msi_compression,
|
compression = self.opts.msi_compression,
|
||||||
app_components = components,
|
app_components = components,
|
||||||
exe_map = self.smap,
|
exe_map = self.smap,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user