From: bneuburg Date: Tue, 18 Jan 2022 00:18:44 +0000 (+0100) Subject: bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889) X-Git-Tag: v3.11.0a5~226 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c47c9e6589eb7a272cfe4d352eb87389eb20ec2f;p=thirdparty%2FPython%2Fcpython.git bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889) The option must be enabled from the command line --- diff --git a/Doc/using/windows.rst b/Doc/using/windows.rst index 68ee09c565e2..041166f4f858 100644 --- a/Doc/using/windows.rst +++ b/Doc/using/windows.rst @@ -165,9 +165,13 @@ of available options is shown below. | CompileAll | Compile all ``.py`` files to | 0 | | | ``.pyc``. | | +---------------------------+--------------------------------------+--------------------------+ -| PrependPath | Add install and Scripts directories | 0 | -| | to :envvar:`PATH` and ``.PY`` to | | -| | :envvar:`PATHEXT` | | +| PrependPath | Prepend install and Scripts | 0 | +| | directories to :envvar:`PATH` and | | +| | add ``.PY`` to :envvar:`PATHEXT` | | ++---------------------------+--------------------------------------+--------------------------+ +| AppendPath | Append install and Scripts | 0 | +| | directories to :envvar:`PATH` and | | +| | add ``.PY`` to :envvar:`PATHEXT` | | +---------------------------+--------------------------------------+--------------------------+ | Shortcuts | Create shortcuts for the interpreter,| 1 | | | documentation and IDLE if installed. | | diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 96d6e2670934..5563e3d84de6 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -200,6 +200,12 @@ Other CPython Implementation Changes have been removed as their values can be derived from ``exc_value``. (Contributed by Irit Katriel in :issue:`45711`.) +* A new command line option for the Windows installer ``AppendPath`` has beend added. + It behaves similiar to ``PrependPath`` but appends the install and scripts directories + instead of prepending it. + (Contributed by Bastian Neuburger in :issue:`44934`.) + + New Modules =========== diff --git a/Misc/NEWS.d/next/Windows/2021-09-01-10-48-11.bpo-44934.W1xPATH.rst b/Misc/NEWS.d/next/Windows/2021-09-01-10-48-11.bpo-44934.W1xPATH.rst new file mode 100644 index 000000000000..0f1c25a0705d --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-09-01-10-48-11.bpo-44934.W1xPATH.rst @@ -0,0 +1 @@ +The installer now offers a command-line only option to add the installation directory to the end of :envvar:`PATH` instead of at the start. diff --git a/Tools/msi/appendpath/appendpath.wixproj b/Tools/msi/appendpath/appendpath.wixproj new file mode 100644 index 000000000000..897087678c56 --- /dev/null +++ b/Tools/msi/appendpath/appendpath.wixproj @@ -0,0 +1,19 @@ + + + + {12B59A06-37CC-4558-A9C8-DAE922E64EF3} + 2.0 + appendpath + Package + ICE71 + + + + + + + + + + + diff --git a/Tools/msi/appendpath/appendpath.wxs b/Tools/msi/appendpath/appendpath.wxs new file mode 100644 index 000000000000..b972f612bf79 --- /dev/null +++ b/Tools/msi/appendpath/appendpath.wxs @@ -0,0 +1,39 @@ + + + + + + + + + + + NOT ALLUSERS=1 + + + + + + + + + + + + ALLUSERS=1 + + + + + + + + + + + + + + + + diff --git a/Tools/msi/appendpath/appendpath_en-US.wxl b/Tools/msi/appendpath/appendpath_en-US.wxl new file mode 100644 index 000000000000..19a2e7734f8c --- /dev/null +++ b/Tools/msi/appendpath/appendpath_en-US.wxl @@ -0,0 +1,6 @@ + + + Append to Path + AppendPath + No !(loc.ProductName) installation was detected. + diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl index 791ce6eab747..053306b0d7dc 100644 --- a/Tools/msi/bundle/Default.wxl +++ b/Tools/msi/bundle/Default.wxl @@ -84,6 +84,8 @@ Select Customize to review current options. Create shortcuts for installed applications Add Python to &environment variables Add &Python [ShortVersion] to PATH + Append Python to &environment variables + Append &Python [ShortVersion] to PATH Install for &all users for &all users (requires elevation) Install &launcher for all users (recommended) diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index 3c54e401330c..fdc2a21d83d5 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -205,6 +205,7 @@ static struct { LPCWSTR regName; LPCWSTR variableName; } OPTIONAL_FEATURES[] = { { L"exe", L"Include_exe" }, { L"lib", L"Include_lib" }, { L"path", L"PrependPath" }, + { L"appendpath", L"AppendPath" }, { L"pip", L"Include_pip" }, { L"tcltk", L"Include_tcltk" }, { L"test", L"Include_test" }, diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets index f882d2ee1f0c..5d8ae6c1d7cb 100644 --- a/Tools/msi/bundle/bundle.targets +++ b/Tools/msi/bundle/bundle.targets @@ -67,6 +67,7 @@ + @@ -104,4 +105,4 @@ - \ No newline at end of file + diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index e2f871889340..a145d840d330 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -1,4 +1,4 @@ - + @@ -87,6 +87,7 @@ + diff --git a/Tools/msi/bundle/packagegroups/postinstall.wxs b/Tools/msi/bundle/packagegroups/postinstall.wxs index 11ab67390705..64f42dd30e8b 100644 --- a/Tools/msi/bundle/packagegroups/postinstall.wxs +++ b/Tools/msi/bundle/packagegroups/postinstall.wxs @@ -20,6 +20,27 @@ + + + + + + + + + + + - \ No newline at end of file +