Fix product code handling for Win64.

This commit is contained in:
Martin v. Löwis 2008-01-23 17:54:14 +00:00
parent d2f4cb8cca
commit 2529aa9840
1 changed files with 15 additions and 10 deletions

View File

@ -68,6 +68,11 @@ upgrade_code='{65E6DE48-A358-434D-AA4F-4AF72DB4718F}'
# both 32-bit and 64-bit versions of Python on a single system.
upgrade_code_64='{6A965A0C-6EE6-4E3A-9983-3263F56311EC}'
# Determine the target architechture
dll_file = "python%s%s.dll" % (major, minor)
dll_path = os.path.join(srcdir, "PCBuild", dll_file)
msilib.set_arch_from_file(dll_path)
if snapshot:
current_version = "%s.%s.%s" % (major, minor, int(time.time()/3600/24))
product_code = msilib.gen_uuid()
@ -76,7 +81,7 @@ else:
if msilib.Win64:
# Bump the last digit of the code by one, so that 32-bit and 64-bit
# releases get separate product codes
digit = hex((int(product_codes[-2],16)+1)%16)[-1]
digit = hex((int(product_code[-2],16)+1)%16)[-1]
product_code = product_code[:-2] + digit + '}'
if full_current_version is None:
@ -155,14 +160,10 @@ def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib):
# Target files (.def and .a) go in PCBuild directory
lib_file = os.path.join(srcdir, "PCBuild", "python%s%s.lib" % (major, minor))
def_file = os.path.join(srcdir, "PCBuild", "python%s%s.def" % (major, minor))
dll_file = "python%s%s.dll" % (major, minor)
mingw_lib = os.path.join(srcdir, "PCBuild", "libpython%s%s.a" % (major, minor))
have_mingw = build_mingw_lib(lib_file, def_file, dll_file, mingw_lib)
# Determine the target architechture
dll_path = os.path.join(srcdir, "PCBuild", dll_file)
msilib.set_arch_from_file(dll_path)
if msilib.pe_type(dll_path) != msilib.pe_type("msisupport.dll"):
raise SystemError, "msisupport.dll for incorrect architecture"
@ -196,11 +197,15 @@ def build_database():
uc = upgrade_code_64
else:
uc = upgrade_code
if msilib.Win64:
productsuffix = " (64 bit)"
else:
productsuffix = ""
# schema represents the installer 2.0 database schema.
# sequence is the set of standard sequences
# (ui/execute, admin/advt/install)
db = msilib.init_database("python-%s%s.msi" % (full_current_version, msilib.arch_ext),
schema, ProductName="Python "+full_current_version,
schema, ProductName="Python "+full_current_version+productsuffix,
ProductCode=product_code,
ProductVersion=current_version,
Manufacturer=u"Python Software Foundation")
@ -249,9 +254,9 @@ def remove_old_versions(db):
# For 2.5, also upgrade installation with upgrade_code
# of 2.5.0 and 2.5.1, since they used the same code for
# 64-bit versions
assert major==2 and minor==5
extra = (upgrade_code, start, "2.5.2",
None, migrate_features, None, "REMOVEOLDVERSION")
assert major=='2' and minor=='5'
extra = [(upgrade_code, start, "2.5.2000",
None, migrate_features, None, "REMOVEOLDVERSION")]
else:
uc = upgrade_code
extra = []
@ -259,7 +264,7 @@ def remove_old_versions(db):
[(uc, start, current_version,
None, migrate_features, None, "REMOVEOLDVERSION"),
(upgrade_code_snapshot, start, "%s.%d.0" % (major, int(minor)+1),
None, migrate_features, None, "REMOVEOLDSNAPSHOT")+extra])
None, migrate_features, None, "REMOVEOLDSNAPSHOT")]+extra)
props = "REMOVEOLDSNAPSHOT;REMOVEOLDVERSION"
# Installer collects the product codes of the earlier releases in
# these properties. In order to allow modification of the properties,