Commit 827d163b authored by Martin v. Löwis's avatar Martin v. Löwis

Fix product code handling for Win64.

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