From 49bca5e19bf0cbdffa3d1b13371787782336f7e4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 1 Dec 2012 16:42:41 +0530 Subject: [PATCH] Windows installer: Add some extra info to the registry --- setup/build_environment.py | 3 +-- setup/installer/windows/wix-template.xml | 8 ++++++-- setup/installer/windows/wix.py | 16 +++++++++++++++- src/calibre/constants.py | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/setup/build_environment.py b/setup/build_environment.py index 22b94b2bd0..afb7c61920 100644 --- a/setup/build_environment.py +++ b/setup/build_environment.py @@ -11,12 +11,11 @@ from distutils.spawn import find_executable from PyQt4 import pyqtconfig -from setup import isosx, iswindows, islinux +from setup import isosx, iswindows, islinux, is64bit OSX_SDK = '/Developer/SDKs/MacOSX10.5.sdk' os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.5' -is64bit = sys.maxsize > 2**32 NMAKE = RC = msvc = MT = win_inc = win_lib = win_ddk = win_ddk_lib_dirs = None if iswindows: diff --git a/setup/installer/windows/wix-template.xml b/setup/installer/windows/wix-template.xml index 72ebcc78d0..ebe59e5bfc 100644 --- a/setup/installer/windows/wix-template.xml +++ b/setup/installer/windows/wix-template.xml @@ -31,6 +31,7 @@ + @@ -38,7 +39,7 @@ - + @@ -122,6 +123,10 @@ + + + + @@ -166,7 +171,6 @@ (i.e. per user installs should work) but left this way as I dont want to deal with the complications --> - diff --git a/setup/installer/windows/wix.py b/setup/installer/windows/wix.py index 2665f635db..e915bdfb23 100644 --- a/setup/installer/windows/wix.py +++ b/setup/installer/windows/wix.py @@ -37,6 +37,7 @@ class WixMixIn: components = self.get_components_from_files() wxs = template.format( app = __appname__, + appfolder = 'Calibre2', version = __version__, upgrade_code = UPGRADE_CODE, ProgramFilesFolder = 'ProgramFiles64Folder' if is64bit else 'ProgramFilesFolder', @@ -118,7 +119,20 @@ class WixMixIn: (fid, f, x, checksum), '' ] - components.append(''.join(c)) + if x.endswith('.exe'): + # Add the executable to app paths so that users can + # launch it from the run dialog even if it is not on + # the path. See http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121(v=vs.85).aspx + c[-1:-1] = [ + (''%(x, fid)), + (''.format(x)), + ] + components.append('\n'.join(c)) return components components = process_dir(os.path.abspath(self.base)) diff --git a/src/calibre/constants.py b/src/calibre/constants.py index bcbc0624fa..164f37314a 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -28,7 +28,7 @@ isunix = isosx or islinux isportable = os.environ.get('CALIBRE_PORTABLE_BUILD', None) is not None ispy3 = sys.version_info.major > 2 isxp = iswindows and sys.getwindowsversion().major < 6 -is64bit = sys.maxint > (1 << 32) +is64bit = sys.maxsize > (1 << 32) isworker = os.environ.has_key('CALIBRE_WORKER') or os.environ.has_key('CALIBRE_SIMPLE_WORKER') if isworker: os.environ.pop('CALIBRE_FORCE_ANSI', None)