diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py --- a/Tools/msi/msi.py +++ b/Tools/msi/msi.py @@ -247,6 +247,7 @@ # accordingly. add_data(db, "Property", [("UpgradeCode", uc), ("WhichUsers", "ALL"), + ("PathOption", "NONE"), ("ProductLine", "Python%s%s" % (major, minor)), ]) db.Commit() @@ -448,6 +449,15 @@ ("SetDLLDirToTarget", 'DLLDIR=""', 751), ]) + #add_data(db, "Component", + # # msidbComponentAttributesRegistryKeyPath = 4 + # [("PrependPath", None, "TARGETDIR", 0, "PREPEND", None)]) + # Prepend TARGETDIR to the system path, and remove it on uninstall. + add_data(db, "Environment", + # TODO: Figure out a way to condition this based on the Component + # table, or something. Nothing I've tried seems to work... + [("Environment", "=-*Path", "[TARGETDIR];[~]", "python.exe")]) + # Execute Sequences add_data(db, "InstallExecuteSequence", [("InitialTargetDir", 'TARGETDIR=""', 750), @@ -457,6 +467,7 @@ ("CompilePyc", "COMPILEALL", 6800), ("CompilePyo", "COMPILEALL", 6801), ("CompileGrammar", "COMPILEALL", 6802), + #("PrependPath", "PREPEND", 6803), ]) add_data(db, "AdminExecuteSequence", [("InitialTargetDir", 'TARGETDIR=""', 750), @@ -464,6 +475,7 @@ ("CompilePyc", "COMPILEALL", 6800), ("CompilePyo", "COMPILEALL", 6801), ("CompileGrammar", "COMPILEALL", 6802), + #("PrependPath", "PREPEND", 6803), ]) ##################################################################### @@ -508,9 +520,9 @@ " would still be Python for DOS.") c = exit_dialog.text("warning", 135, 200, 220, 40, 0x30003, - "{\\VerdanaRed9}Warning: Python 2.5.x is the last " - "Python release for Windows 9x.") - c.condition("Hide", "NOT Version9X") + "{\\VerdanaRed9}Note: You will need to logout for " + "Path changes to be applied.") + c.condition("Hide", "NOT PREPEND") exit_dialog.text("Description", 135, 235, 220, 20, 0x30003, "Click the Finish button to exit the Installer.") @@ -668,9 +680,12 @@ c.mapping("SelectionNoItems","Enabled") c.event("SpawnDialog", "DiskCostDlg") - c=features.xbutton("Advanced", "Advanced", None, 0.30) + c=features.xbutton("Advanced", "Advanced", None, 0.25) c.event("SpawnDialog", "AdvancedDlg") + c=features.xbutton("Path", "Path", None, 0.40) + c.event("SpawnDialog", "PathDlg") + c=features.text("ItemDescription", 140, 180, 210, 30, 3, "Multiline description of the currently selected item.") c.mapping("SelectionDescription","Text") @@ -740,6 +755,18 @@ c.event("EndDialog", "Return") ##################################################################### + # Path Dialog. + pathadder = PyDialog(db, "PathDlg", x, y, w, h, modal, title, + "PrependPath", "Ok", "Ok") + pathadder.title("Path Options for [ProductName]") + + pathadder.checkbox("PrependPath", 135, 60, 235, 80, 3, + "PREPEND", "Prepend [ProductName] to the Path", "Ok") + + c = pathadder.cancel("Ok", "PrependPath", name="Ok") # Button just has location of cancel button. + c.event("EndDialog", "Return") + + ##################################################################### # Existing Directory dialog dlg = Dialog(db, "ExistingDirectoryDlg", 50, 30, 200, 80, modal, title, "No", "No", "No") @@ -829,7 +856,7 @@ # (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") @@ -854,6 +881,10 @@ testsuite = Feature(db, "Testsuite", "Test suite", "Python test suite (Lib/test/)", 11, parent = default_feature, attributes=2|8) + # TODO-BC: I don't think this is how we want to do it, but it's an option. + #prepend_path = Feature(db, "PrependPath", "Prepend Path", + # "Prepend [TARGETDIR] to the system Path", 13, + # parent = default_feature, attributes=2|8) def extract_msvcr90(): # Find the redistributable files @@ -1023,7 +1054,7 @@ lib.add_file("empty.vbs") lib.add_file("Sine-1000Hz-300ms.aif") lib.glob("*.uue") - lib.glob("*.pem") + #lib.glob("*.pem") lib.glob("*.pck") lib.glob("cfgparser.*") lib.add_file("zip_cp437_header.zip")