]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix #3561. Add an option to place the Python installation into the Windows Path envir...
authorBrian Curtin <brian@python.org>
Wed, 25 Apr 2012 13:12:37 +0000 (08:12 -0500)
committerBrian Curtin <brian@python.org>
Wed, 25 Apr 2012 13:12:37 +0000 (08:12 -0500)
Misc/NEWS
Tools/msi/msi.py

index d8c91d3312fa58d58ac07e8f74692d6257b50e53..f0f0807d1e5d460955c6302720216310c92eec79 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -189,6 +189,9 @@ Tests
 Tools / Demos
 -------------
 
+- Issue #3561: The Windows installer now has an option, off by default, for
+  placing the Python installation into the system "Path" environment variable.
+
 - Issue #13165: stringbench is now available in the Tools/stringbench folder.
   It used to live in its own SVN project.
 
index 38f34438c3443c9e1bfc14d0b71697aa4ee9008d..77489dc9f899f6378d41030aa266e1928497a0ba 100644 (file)
@@ -454,6 +454,10 @@ def add_ui(db):
               ("SetDLLDirToTarget", 'DLLDIR=""', 751),
              ])
 
+    # Prepend TARGETDIR to the system path, and remove it on uninstall.
+    add_data(db, "Environment",
+             [("PathAddition", "=-*Path", "[TARGETDIR];[~]", "REGISTRY.path")])
+
     # Execute Sequences
     add_data(db, "InstallExecuteSequence",
             [("InitialTargetDir", 'TARGETDIR=""', 750),
@@ -677,11 +681,11 @@ def add_ui(db):
     c=features.xbutton("Advanced", "Advanced", None, 0.30)
     c.event("SpawnDialog", "AdvancedDlg")
 
-    c=features.text("ItemDescription", 140, 180, 210, 30, 3,
+    c=features.text("ItemDescription", 140, 180, 210, 40, 3,
                   "Multiline description of the currently selected item.")
     c.mapping("SelectionDescription","Text")
 
-    c=features.text("ItemSize", 140, 210, 210, 45, 3,
+    c=features.text("ItemSize", 140, 225, 210, 33, 3,
                     "The size of the currently selected item.")
     c.mapping("SelectionSize", "Text")
 
@@ -835,7 +839,7 @@ 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
+    global default_feature, tcltk, htmlfiles, tools, testsuite, ext_feature, private_crt, prepend_path
     default_feature = Feature(db, "DefaultFeature", "Python",
                               "Python Interpreter and Libraries",
                               1, directory = "TARGETDIR")
@@ -860,6 +864,15 @@ def add_features(db):
     testsuite = Feature(db, "Testsuite", "Test suite",
                         "Python test suite (Lib/test/)", 11,
                         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
+    # at least level higher.
+    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,
+                        parent = default_feature, attributes=2|8,
+                        level=2)
 
 def extract_msvcr90():
     # Find the redistributable files
@@ -1146,6 +1159,8 @@ def add_registry(db):
                "InstallPath"),
               ("REGISTRY.doc", msilib.gen_uuid(), "TARGETDIR", registry_component, None,
                "Documentation"),
+              ("REGISTRY.path", msilib.gen_uuid(), "TARGETDIR", registry_component, None,
+              None),
               ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", registry_component,
                None, None)] + tcldata)
     # See "FeatureComponents Table".
@@ -1162,6 +1177,7 @@ def add_registry(db):
     add_data(db, "FeatureComponents",
              [(default_feature.id, "REGISTRY"),
               (htmlfiles.id, "REGISTRY.doc"),
+              (prepend_path.id, "REGISTRY.path"),
               (ext_feature.id, "REGISTRY.def")] +
               tcldata
               )