Kaydet (Commit) 3b0dad06 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Reuse componentids for *.dll across minor releases.

Indicate to the user when this is an upgrade installation.
Make CHM file non-advertised.
üst 5986a01d
...@@ -122,6 +122,20 @@ if major+minor <= "23": ...@@ -122,6 +122,20 @@ if major+minor <= "23":
'parser.pyd', 'parser.pyd',
]) ])
# Well-known component UUIDs
# These are needed for SharedDLLs reference counter; if
# a different UUID was used for each incarnation of, say,
# python24.dll, an upgrade would set the reference counter
# from 1 to 2 (due to what I consider a bug in MSI)
# Using the same UUID is fine since these files are versioned,
# so Installer will always keep the newest version.
msvcr71_uuid = "{8666C8DD-D0B4-4B42-928E-A69E32FA5D4D}"
pythondll_uuid = {
"24":"{9B81E618-2301-4035-AC77-75D9ABEB7301}",
"25":"{2e41b118-38bd-4c1b-a840-6977efd1b911}"
} [major+minor]
# Build the mingw import library, libpythonXY.a # Build the mingw import library, libpythonXY.a
# This requires 'nm' and 'dlltool' executables on your PATH # This requires 'nm' and 'dlltool' executables on your PATH
def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib): def build_mingw_lib(lib_file, def_file, dll_file, mingw_lib):
...@@ -220,6 +234,7 @@ def build_database(): ...@@ -220,6 +234,7 @@ def build_database():
# accordingly. # accordingly.
add_data(db, "Property", [("UpgradeCode", uc), add_data(db, "Property", [("UpgradeCode", uc),
("WhichUsers", "ALL"), ("WhichUsers", "ALL"),
("ProductLine", "Python%s%s" % (major, minor)),
]) ])
db.Commit() db.Commit()
return db return db
...@@ -378,6 +393,7 @@ def add_ui(db): ...@@ -378,6 +393,7 @@ def add_ui(db):
[("DlgFont8", "Tahoma", 9, None, 0), [("DlgFont8", "Tahoma", 9, None, 0),
("DlgFontBold8", "Tahoma", 8, None, 1), #bold ("DlgFontBold8", "Tahoma", 8, None, 1), #bold
("VerdanaBold10", "Verdana", 10, None, 1), ("VerdanaBold10", "Verdana", 10, None, 1),
("VerdanaRed9", "Verdana", 9, 255, 0),
]) ])
compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x badsyntax [TARGETDIR]Lib" compileargs = r"-Wi [TARGETDIR]Lib\compileall.py -f -x badsyntax [TARGETDIR]Lib"
...@@ -566,6 +582,9 @@ def add_ui(db): ...@@ -566,6 +582,9 @@ def add_ui(db):
seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title, seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title,
"Next", "Next", "Cancel") "Next", "Next", "Cancel")
seldlg.title("Select Destination Directory") seldlg.title("Select Destination Directory")
c = seldlg.text("Existing", 135, 25, 235, 30, 0x30003,
"{\VerdanaRed9}This update will replace your existing [ProductLine] installation.")
c.condition("Hide", 'REMOVEOLDVERSION="" and REMOVEOLDSNAPSHOT=""')
seldlg.text("Description", 135, 50, 220, 40, 0x30003, seldlg.text("Description", 135, 50, 220, 40, 0x30003,
"Please select a directory for the [ProductName] files.") "Please select a directory for the [ProductName] files.")
...@@ -865,7 +884,7 @@ def add_files(db): ...@@ -865,7 +884,7 @@ def add_files(db):
dlldir = PyDirectory(db, cab, root, srcdir, "DLLDIR", ".") dlldir = PyDirectory(db, cab, root, srcdir, "DLLDIR", ".")
pydll = "python%s%s.dll" % (major, minor) pydll = "python%s%s.dll" % (major, minor)
pydllsrc = srcdir + "/PCBuild/" + pydll pydllsrc = srcdir + "/PCBuild/" + pydll
dlldir.start_component("DLLDIR", flags = 8, keyfile = pydll) dlldir.start_component("DLLDIR", flags = 8, keyfile = pydll, uuid = pythondll_uuid)
installer = msilib.MakeInstaller() installer = msilib.MakeInstaller()
pyversion = installer.FileVersion(pydllsrc, 0) pyversion = installer.FileVersion(pydllsrc, 0)
if not snapshot: if not snapshot:
...@@ -877,7 +896,7 @@ def add_files(db): ...@@ -877,7 +896,7 @@ def add_files(db):
language=installer.FileVersion(pydllsrc, 1)) language=installer.FileVersion(pydllsrc, 1))
# XXX determine dependencies # XXX determine dependencies
version, lang = extract_msvcr71() version, lang = extract_msvcr71()
dlldir.start_component("msvcr71", flags=8, keyfile="msvcr71.dll") dlldir.start_component("msvcr71", flags=8, keyfile="msvcr71.dll", uuid=msvcr71_uuid)
dlldir.add_file("msvcr71.dll", src=os.path.abspath("msvcr71.dll"), dlldir.add_file("msvcr71.dll", src=os.path.abspath("msvcr71.dll"),
version=version, language=lang) version=version, language=lang)
tmpfiles.append("msvcr71.dll") tmpfiles.append("msvcr71.dll")
...@@ -1047,6 +1066,8 @@ def add_registry(db): ...@@ -1047,6 +1066,8 @@ def add_registry(db):
# msidbComponentAttributesRegistryKeyPath = 4 # msidbComponentAttributesRegistryKeyPath = 4
[("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None, [("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None,
"InstallPath"), "InstallPath"),
("REGISTRY.doc", msilib.gen_uuid(), "TARGETDIR", 4, None,
"Documentation"),
("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4, ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4,
None, None)] + tcldata) None, None)] + tcldata)
# See "FeatureComponents Table". # See "FeatureComponents Table".
...@@ -1062,6 +1083,7 @@ def add_registry(db): ...@@ -1062,6 +1083,7 @@ def add_registry(db):
tcldata = [(tcltk.id, "pythonw.exe")] tcldata = [(tcltk.id, "pythonw.exe")]
add_data(db, "FeatureComponents", add_data(db, "FeatureComponents",
[(default_feature.id, "REGISTRY"), [(default_feature.id, "REGISTRY"),
(htmlfiles.id, "REGISTRY.doc"),
(ext_feature.id, "REGISTRY.def")] + (ext_feature.id, "REGISTRY.def")] +
tcldata tcldata
) )
...@@ -1130,7 +1152,7 @@ def add_registry(db): ...@@ -1130,7 +1152,7 @@ def add_registry(db):
("PythonPath", -1, prefix+r"\PythonPath", "", ("PythonPath", -1, prefix+r"\PythonPath", "",
r"[TARGETDIR]Lib;[TARGETDIR]DLLs;[TARGETDIR]Lib\lib-tk", "REGISTRY"), r"[TARGETDIR]Lib;[TARGETDIR]DLLs;[TARGETDIR]Lib\lib-tk", "REGISTRY"),
("Documentation", -1, prefix+r"\Help\Main Python Documentation", "", ("Documentation", -1, prefix+r"\Help\Main Python Documentation", "",
r"[TARGETDIR]Doc\Python%s%s.chm" % (major, minor), "REGISTRY"), r"[TARGETDIR]Doc\Python%s%s.chm" % (major, minor), "REGISTRY.doc"),
("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"), ("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"),
("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", ("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe",
"", r"[TARGETDIR]Python.exe", "REGISTRY.def") "", r"[TARGETDIR]Python.exe", "REGISTRY.def")
...@@ -1154,9 +1176,14 @@ def add_registry(db): ...@@ -1154,9 +1176,14 @@ def add_registry(db):
[# Advertised shortcuts: targets are features, not files [# Advertised shortcuts: targets are features, not files
("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe", ("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe",
default_feature.id, None, None, None, "python_icon.exe", 2, None, "TARGETDIR"), default_feature.id, None, None, None, "python_icon.exe", 2, None, "TARGETDIR"),
("Manual", "MenuDir", "MANUAL|Python Manuals", "documentation", # Advertising the Manual breaks on (some?) Win98, and the shortcut lacks an
htmlfiles.id, None, None, None, None, None, None, None), # icon first.
#("Manual", "MenuDir", "MANUAL|Python Manuals", "documentation",
# htmlfiles.id, None, None, None, None, None, None, None),
## Non-advertised shortcuts: must be associated with a registry component ## Non-advertised shortcuts: must be associated with a registry component
("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY.doc",
"[#Python%s%s.chm]" % (major,minor), None,
None, None, None, None, None, None),
("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY", ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY",
SystemFolderName+"msiexec", "/x%s" % product_code, SystemFolderName+"msiexec", "/x%s" % product_code,
None, None, None, None, None, None), None, None, None, None, None, None),
......
...@@ -445,7 +445,7 @@ class Directory: ...@@ -445,7 +445,7 @@ class Directory:
blogical = None blogical = None
add_data(db, "Directory", [(logical, blogical, default)]) add_data(db, "Directory", [(logical, blogical, default)])
def start_component(self, component = None, feature = None, flags = None, keyfile = None): def start_component(self, component = None, feature = None, flags = None, keyfile = None, uuid=None):
"""Add an entry to the Component table, and make this component the current for this """Add an entry to the Component table, and make this component the current for this
directory. If no component name is given, the directory name is used. If no feature directory. If no component name is given, the directory name is used. If no feature
is given, the current feature is used. If no flags are given, the directory's default is given, the current feature is used. If no flags are given, the directory's default
...@@ -453,7 +453,10 @@ class Directory: ...@@ -453,7 +453,10 @@ class Directory:
table.""" table."""
if flags is None: if flags is None:
flags = self.componentflags flags = self.componentflags
if uuid is None:
uuid = gen_uuid() uuid = gen_uuid()
else:
uuid = uuid.upper()
if component is None: if component is None:
component = self.logical component = self.logical
self.component = component self.component = component
......
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