diff options
Diffstat (limited to 'Tools/msi/msi.py')
-rw-r--r-- | Tools/msi/msi.py | 47 |
1 files changed, 38 insertions, 9 deletions
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py index 5ed025d7945..e816c8ac8a1 100644 --- a/Tools/msi/msi.py +++ b/Tools/msi/msi.py @@ -99,7 +99,9 @@ extensions = [ '_multiprocessing.pyd', '_lzma.pyd', '_decimal.pyd', - '_testbuffer.pyd' + '_testbuffer.pyd', + '_testimportmultiple.pyd', + '_overlapped.pyd', ] # Well-known component UUIDs @@ -119,6 +121,7 @@ pythondll_uuid = { "31":"{4afcba0b-13e4-47c3-bebe-477428b46913}", "32":"{3ff95315-1096-4d31-bd86-601d5438ad5e}", "33":"{f7581ca4-d368-4eea-8f82-d48c64c4f047}", + "34":"{7A0C5812-2583-40D9-BCBB-CD7485F11377}", } [major+minor] # Compute the name that Sphinx gives to the docfile @@ -417,6 +420,8 @@ def add_ui(db): compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TARGETDIR]Lib"' lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"' + updatepipargs = r'-m ensurepip -U' + removepipargs = r'-m ensurepip._uninstall' # See "CustomAction Table" add_data(db, "CustomAction", [ # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty @@ -433,6 +438,9 @@ def add_ui(db): ("CompilePyc", 18, "python.exe", compileargs), ("CompilePyo", 18, "python.exe", "-O "+compileargs), ("CompileGrammar", 18, "python.exe", lib2to3args), + # msidbCustomActionTypeInScript (1024); run during actual installation + ("UpdatePip", 18+1024, "python.exe", updatepipargs), + ("RemovePip", 18, "python.exe", removepipargs), ]) # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table" @@ -459,7 +467,7 @@ def add_ui(db): # Prepend TARGETDIR to the system path, and remove it on uninstall. add_data(db, "Environment", - [("PathAddition", "=-*Path", "[TARGETDIR];[~]", "REGISTRY.path")]) + [("PathAddition", "=-*Path", "[TARGETDIR];[TARGETDIR]Scripts;[~]", "REGISTRY.path")]) # Execute Sequences add_data(db, "InstallExecuteSequence", @@ -469,6 +477,12 @@ def add_ui(db): ("SetLauncherDirToWindows", 'LAUNCHERDIR="" and ' + sys32cond, 753), ("SetLauncherDirToTarget", 'LAUNCHERDIR="" and not ' + sys32cond, 754), ("UpdateEditIDLE", None, 1050), + # run command if install state of pip changes to INSTALLSTATE_LOCAL + # run after InstallFiles + ("UpdatePip", "&pip_feature=3", 4001), + # remove pip when state changes to INSTALLSTATE_ABSENT + # run before RemoveFiles + ("RemovePip", "&pip_feature=2", 3499), ("CompilePyc", "COMPILEALL", 6800), ("CompilePyo", "COMPILEALL", 6801), ("CompileGrammar", "COMPILEALL", 6802), @@ -748,7 +762,8 @@ def add_ui(db): advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title, "CompilePyc", "Ok", "Ok") advanced.title("Advanced Options for [ProductName]") - # A radio group with two options: allusers, justme + + # A checkbox whether to build pyc files advanced.checkbox("CompilePyc", 135, 60, 230, 50, 3, "COMPILEALL", "Compile .py files to byte code after installation", "Ok") @@ -845,7 +860,8 @@ def add_features(db): # (i.e. additional Python libraries) need to follow the parent feature. # Features that have no advertisement trigger (e.g. the test suite) # must not support advertisement - global default_feature, tcltk, htmlfiles, tools, testsuite, ext_feature, private_crt, prepend_path + global default_feature, tcltk, htmlfiles, tools, testsuite + global ext_feature, private_crt, prepend_path, pip_feature default_feature = Feature(db, "DefaultFeature", "Python", "Python Interpreter and Libraries", 1, directory = "TARGETDIR") @@ -867,8 +883,14 @@ def add_features(db): tools = Feature(db, "Tools", "Utility Scripts", "Python utility scripts (Tools/)", 9, parent = default_feature, attributes=2) + # pip installation isn't enabled by default until a clean uninstall procedure + # becomes possible + pip_feature = Feature(db, "pip_feature", "pip", + "Install (or upgrade from an earlier version) pip, " + "a tool for installing and managing Python packages.", 11, + parent = default_feature, attributes=2|8) testsuite = Feature(db, "Testsuite", "Test suite", - "Python test suite (Lib/test/)", 11, + "Python test suite (Lib/test/)", 13, parent = default_feature, attributes=2|8) # prepend_path is an additional feature which is to be off by default. # Since the default level for the above features is 1, this needs to be @@ -876,7 +898,7 @@ def add_features(db): prepend_path = Feature(db, "PrependPath", "Add python.exe to Path", "Prepend [TARGETDIR] to the system Path variable. " "This allows you to type 'python' into a command " - "prompt without needing the full path.", 13, + "prompt without needing the full path.", 15, parent = default_feature, attributes=2|8, level=2) @@ -954,8 +976,6 @@ def add_files(db): # Add all executables, icons, text files into the TARGETDIR component root = PyDirectory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") default_feature.set_current() - if not msilib.Win64: - root.add_file("%s/w9xpopen.exe" % PCBUILD) root.add_file("README.txt", src="README") root.add_file("NEWS.txt", src="Misc/NEWS") generate_license() @@ -1185,6 +1205,8 @@ def add_registry(db): "Documentation"), ("REGISTRY.path", msilib.gen_uuid(), "TARGETDIR", registry_component, None, None), + ("REGISTRY.ensurepip", msilib.gen_uuid(), "TARGETDIR", registry_component, "EnsurePipRun", + None), ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", registry_component, None, None)] + tcldata) # See "FeatureComponents Table". @@ -1202,6 +1224,7 @@ def add_registry(db): [(default_feature.id, "REGISTRY"), (htmlfiles.id, "REGISTRY.doc"), (prepend_path.id, "REGISTRY.path"), + (pip_feature.id, "REGISTRY.ensurepip"), (ext_feature.id, "REGISTRY.def")] + tcldata ) @@ -1269,6 +1292,10 @@ def add_registry(db): "{60254CA5-953B-11CF-8C96-00AA00B8708C}", "REGISTRY.def"), ]) + # PATHEXT + add_data(db, "Environment", + [("PathExtAddition", "=-*PathExt", "[~];.PY", "REGISTRY.def")]) + # Registry keys prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version) add_data(db, "Registry", @@ -1284,7 +1311,9 @@ def add_registry(db): "", r"[TARGETDIR]Python.exe", "REGISTRY.def"), ("DisplayIcon", -1, r"Software\Microsoft\Windows\CurrentVersion\Uninstall\%s" % product_code, - "DisplayIcon", "[TARGETDIR]python.exe", "REGISTRY") + "DisplayIcon", "[TARGETDIR]python.exe", "REGISTRY"), + # Fake registry entry to allow installer to track whether ensurepip has been run + ("EnsurePipRun", -1, prefix+r"\EnsurePipRun", "", "#1", "REGISTRY.ensurepip"), ]) # Shortcuts, see "Shortcut Table" add_data(db, "Directory", |