|
6 | 6 | import uisample |
7 | 7 | from win32com.client import constants |
8 | 8 | from distutils.spawn import find_executable |
9 | | -from uuids import product_codes |
10 | 9 | import tempfile |
11 | 10 |
|
12 | 11 | # Settings can be overridden in config.py below |
|
77 | 76 |
|
78 | 77 | if snapshot: |
79 | 78 | current_version = "%s.%s.%s" % (major, minor, int(time.time()/3600/24)) |
80 | | - product_code = msilib.gen_uuid() |
81 | | -else: |
82 | | - product_code = product_codes[current_version] |
83 | 79 |
|
84 | 80 | if full_current_version is None: |
85 | 81 | full_current_version = current_version |
@@ -187,12 +183,19 @@ def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib): |
187 | 183 | msilib.set_arch_from_file(dll_path) |
188 | 184 | if msilib.pe_type(dll_path) != msilib.pe_type("msisupport.dll"): |
189 | 185 | raise SystemError("msisupport.dll for incorrect architecture") |
| 186 | + |
190 | 187 | if msilib.Win64: |
191 | 188 | upgrade_code = upgrade_code_64 |
192 | | - # Bump the last digit of the code by one, so that 32-bit and 64-bit |
193 | | - # releases get separate product codes |
194 | | - digit = hex((int(product_code[-2],16)+1)%16)[-1] |
195 | | - product_code = product_code[:-2] + digit + '}' |
| 189 | + |
| 190 | +if snapshot: |
| 191 | + product_code = msilib.gen_uuid() |
| 192 | +else: |
| 193 | + # official release: generate UUID from the download link that the file will have |
| 194 | + import uuid |
| 195 | + product_code = uuid.uuid3(uuid.NAMESPACE_URL, |
| 196 | + 'http://www.python.org/ftp/python/%s.%s.%s/python-%s%s.msi' % |
| 197 | + (major, minor, micro, full_current_version, msilib.arch_ext)) |
| 198 | + product_code = '{%s}' % product_code |
196 | 199 |
|
197 | 200 | if testpackage: |
198 | 201 | ext = 'px' |
|
0 commit comments