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 -r' # does not yet work
+ removepipargs = r'-m ensurepip._uninstall'
# See "CustomAction Table"
add_data(db, "CustomAction", [
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
("CompileGrammar", 18, "python.exe", lib2to3args),
# msidbCustomActionTypeInScript (1024); run during actual installation
("UpdatePip", 18+1024, "python.exe", updatepipargs),
- #("RemovePip", 18, "python.exe", removepipargs),
+ ("RemovePip", 18, "python.exe", removepipargs),
])
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
("UpdateEditIDLE", None, 1050),
# run command if install state of pip changes to INSTALLSTATE_LOCAL
# run after InstallFiles
- ("UpdatePip", "&pip=3", 4001),
+ ("UpdatePip", "&pip_feature=3", 4001),
# remove pip when state changes to INSTALLSTATE_ABSENT
# run before RemoveFiles
- #("RemovePip", "&pip=2", 3499),
+ ("RemovePip", "&pip_feature=2", 3499),
("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801),
("CompileGrammar", "COMPILEALL", 6802),
# Features that have no advertisement trigger (e.g. the test suite)
# must not support advertisement
global default_feature, tcltk, htmlfiles, tools, testsuite
- global ext_feature, private_crt, prepend_path, update_pip
+ global ext_feature, private_crt, prepend_path, pip_feature
default_feature = Feature(db, "DefaultFeature", "Python",
"Python Interpreter and Libraries",
1, directory = "TARGETDIR")
parent = default_feature, attributes=2)
# pip installation isn't enabled by default until a clean uninstall procedure
# becomes possible
- update_pip = Feature(db, "pip", "pip",
+ 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, level=2)
+ parent = default_feature, attributes=2|8)
testsuite = Feature(db, "Testsuite", "Test suite",
"Python test suite (Lib/test/)", 13,
parent = default_feature, attributes=2|8)
"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".
[(default_feature.id, "REGISTRY"),
(htmlfiles.id, "REGISTRY.doc"),
(prepend_path.id, "REGISTRY.path"),
+ (pip_feature.id, "REGISTRY.ensurepip"),
(ext_feature.id, "REGISTRY.def")] +
tcldata
)
"", 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",