From d135f20ae8887acc7716561bc8f4c7eb6d58d24c Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 9 Jan 2018 19:14:46 +1100 Subject: [PATCH] bpo-32507: Change Windows install to include app-local UCRT (#5119) --- .../2018-01-07-12-32-49.bpo-32507.vB4gxk.rst | 2 + .../2018-01-07-12-33-21.bpo-29911.ewSJKb.rst | 1 + PC/dllbase_nt.txt | 77 ------------------- PCbuild/_bz2.vcxproj | 3 - PCbuild/_ctypes.vcxproj | 1 - PCbuild/_decimal.vcxproj | 3 - PCbuild/_elementtree.vcxproj | 3 - PCbuild/_msi.vcxproj | 1 - PCbuild/_multiprocessing.vcxproj | 1 - PCbuild/_overlapped.vcxproj | 1 - PCbuild/_socket.vcxproj | 1 - PCbuild/_sqlite3.vcxproj | 3 - PCbuild/_testbuffer.vcxproj | 5 -- PCbuild/_testcapi.vcxproj | 5 -- PCbuild/_testimportmultiple.vcxproj | 5 -- PCbuild/python.vcxproj | 1 - PCbuild/pythoncore.vcxproj | 1 - PCbuild/pythonw.vcxproj | 1 - PCbuild/select.vcxproj | 1 - PCbuild/unicodedata.vcxproj | 5 -- PCbuild/xxlimited.vcxproj | 1 - .../PythonBootstrapperApplication.cpp | 32 -------- Tools/msi/bundle/bundle.targets | 1 + Tools/msi/bundle/packagegroups/crt.wxs | 50 +++--------- Tools/msi/exe/exe.wxs | 6 +- Tools/msi/get_externals.bat | 2 +- Tools/msi/msi.props | 9 +-- Tools/msi/ucrt/ucrt.wixproj | 28 +++++++ Tools/msi/ucrt/ucrt.wxs | 14 ++++ Tools/msi/ucrt/ucrt_en-US.wxl | 5 ++ Tools/msi/uploadrelease.proj | 2 +- 31 files changed, 71 insertions(+), 200 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2018-01-07-12-32-49.bpo-32507.vB4gxk.rst create mode 100644 Misc/NEWS.d/next/Windows/2018-01-07-12-33-21.bpo-29911.ewSJKb.rst delete mode 100644 PC/dllbase_nt.txt create mode 100644 Tools/msi/ucrt/ucrt.wixproj create mode 100644 Tools/msi/ucrt/ucrt.wxs create mode 100644 Tools/msi/ucrt/ucrt_en-US.wxl diff --git a/Misc/NEWS.d/next/Windows/2018-01-07-12-32-49.bpo-32507.vB4gxk.rst b/Misc/NEWS.d/next/Windows/2018-01-07-12-32-49.bpo-32507.vB4gxk.rst new file mode 100644 index 00000000000..010271ca24e --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-01-07-12-32-49.bpo-32507.vB4gxk.rst @@ -0,0 +1,2 @@ +Use app-local UCRT install rather than the proper update for old versions of +Windows. diff --git a/Misc/NEWS.d/next/Windows/2018-01-07-12-33-21.bpo-29911.ewSJKb.rst b/Misc/NEWS.d/next/Windows/2018-01-07-12-33-21.bpo-29911.ewSJKb.rst new file mode 100644 index 00000000000..7f311efef46 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2018-01-07-12-33-21.bpo-29911.ewSJKb.rst @@ -0,0 +1 @@ +Ensure separate Modify and Uninstall buttons are displayed. diff --git a/PC/dllbase_nt.txt b/PC/dllbase_nt.txt deleted file mode 100644 index 93a15d12bf8..00000000000 --- a/PC/dllbase_nt.txt +++ /dev/null @@ -1,77 +0,0 @@ -In Win32, DLL's are "pre-linked" using a specified base address. -When the DLL is loaded, an attempt is made to place it at -that address. If that address is already in use, a new base address -is selected, and the DLL subject to fixups. Apparently, these -fixups are very slow, and significant performance gains can be -made by selecting a good base address. - -This document is to allocate base addresses to core Python -and Python .PYD files, to give a better change of optimal performance. -This base address is passed to the linker using the /BASE -command line switch. - - -Python.exe/Pythonw.exe - 1d000000 - 1e000000 (-1) -Python.dll - 1e000000 - 1e100000 (-1) - -Standard Extension Modules 1e100000 - 1e200000 "" - - _symtable 1e100000 - 1e110000 pyd removed in 2.4 - - bsddb 1e180000 - 1e188000 pyd removed in 3.0 - - _tkinter 1e190000 - 1e1A0000 - - parser 1e1A0000 - 1e1B0000 pyd removed in 2.4 - - zlib 1e1B0000 - 1e1C0000 - - winreg 1e1C0000 - 1e1D0000 pyd removed in 2.4 - - _socket 1e1D0000 - 1e1E0000 - - _sre 1e1E0000 - 1e1F0000 pyd removed in 2.4 - - mmap 1e1F0000 - 1e1FFFFF pyd removed in 2.4 - -More standard extensions 1D100000 - 1e000000 - - pyexpat 1D100000 - 1D110000 - - select 1D110000 - 1D120000 - - unicodedata 1D120000 - 1D160000 - - winsound 1D160000 - 1D170000 - - bZ2 1D170000 - 1D180000 - - datetime 1D180000 - 1D190000 pyd removed in 2.4 - - _csv 1D190000 - 1D1A0000 pyd removed in 2.4 - - _ctypes 1D1A0000 - 1D1B0000 - -Other extension modules - - win32api 1e200000 - 1e220000 - - win32ras 1e220000 - 1e230000 - - win32lz 1e230000 - 1e240000 - - timer 1e240000 - 1e250000 - - mmapfile 1e250000 - 1e260000 - - win32pipe 1e260000 - 1e270000 - - avl 1e270000 - 1e270000 - - dbhash 1e280000 - 1e290000 - - win32net 1e290000 - 1e2A0000 - - win32security 1e2A0000 - 1e2B0000 - - win32print 1e2B0000 - 1e2c0000 - - 1e2d0000 - 1e2e0000 - - win32gui 1e2e0000 - 1e2f0000 - - _imaging 1e2f0000 - 1e300000 - - multiarray 1e300000 - 1e310000 - - win32help 1e310000 - 1e320000 - - win32clipboard 1e320000 - 1e330000 - - win2kras 1e330000 - 1e340000 - - pythoncom 1e340000 - 1e400000 - - win32ui 1e400000 - 1e500000 - - win32uiole 1e500000 - 1e600000 - - pywintypes 1e600000 - 1e700000 - - win32process 1e700000 - 1e800000 - - odbc 1e710000 - 1e720000 - - dbi 1e720000 - 1e730000 - - win32file 1e730000 - 1e740000 - - win32wnet 1e740000 - 1e750000 - - win32com.shell 1e750000 - 1e760000 - - win32com.internet 1e760000 - 1e770000 - - win32com.exchange 1e770000 - 1e780000 - - win32com.exchdapi 1e780000 - 1e790000 - - win32com.axscript 1e790000 - 1e7a0000 - - win32com.axdebug 1e7b0000 - 1e7c0000 - - win32com.adsi 1e7f0000 - 1e800000 - - win32event 1e810000 - 1e820000 - - win32evtlog 1e820000 - 1e830000 - - win32com.axcontrol 1e830000 - 1e840000 - - diff --git a/PCbuild/_bz2.vcxproj b/PCbuild/_bz2.vcxproj index b3ab378c6ed..3c21848ae28 100644 --- a/PCbuild/_bz2.vcxproj +++ b/PCbuild/_bz2.vcxproj @@ -66,9 +66,6 @@ WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) 4244;4267;%(DisableSpecificWarnings) - - 0x1D170000 - diff --git a/PCbuild/_ctypes.vcxproj b/PCbuild/_ctypes.vcxproj index 43d51f82965..81670a75bd6 100644 --- a/PCbuild/_ctypes.vcxproj +++ b/PCbuild/_ctypes.vcxproj @@ -64,7 +64,6 @@ ..\Modules\_ctypes\libffi_msvc;%(AdditionalIncludeDirectories) - 0x1D1A0000 /EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions) diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj index 9c9c19abbe3..b14f31093ff 100644 --- a/PCbuild/_decimal.vcxproj +++ b/PCbuild/_decimal.vcxproj @@ -66,9 +66,6 @@ CONFIG_64;%(PreprocessorDefinitions) ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) - - 0x1D1A0000 - diff --git a/PCbuild/_elementtree.vcxproj b/PCbuild/_elementtree.vcxproj index 0db61f20818..2338af4505b 100644 --- a/PCbuild/_elementtree.vcxproj +++ b/PCbuild/_elementtree.vcxproj @@ -64,9 +64,6 @@ ..\Modules\expat;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions) - - 0x1D100000 - diff --git a/PCbuild/_msi.vcxproj b/PCbuild/_msi.vcxproj index 3895d450f35..6be83ca6860 100644 --- a/PCbuild/_msi.vcxproj +++ b/PCbuild/_msi.vcxproj @@ -62,7 +62,6 @@ cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies) - 0x1D160000 diff --git a/PCbuild/_multiprocessing.vcxproj b/PCbuild/_multiprocessing.vcxproj index bb2bb4114c9..0e3f376eaf9 100644 --- a/PCbuild/_multiprocessing.vcxproj +++ b/PCbuild/_multiprocessing.vcxproj @@ -62,7 +62,6 @@ ws2_32.lib;%(AdditionalDependencies) - 0x1e1D0000 diff --git a/PCbuild/_overlapped.vcxproj b/PCbuild/_overlapped.vcxproj index 26b2d214c35..829cc81b623 100644 --- a/PCbuild/_overlapped.vcxproj +++ b/PCbuild/_overlapped.vcxproj @@ -62,7 +62,6 @@ ws2_32.lib;%(AdditionalDependencies) - 0x1D110000 diff --git a/PCbuild/_socket.vcxproj b/PCbuild/_socket.vcxproj index d5c4d1b5b6f..9e27891081e 100644 --- a/PCbuild/_socket.vcxproj +++ b/PCbuild/_socket.vcxproj @@ -62,7 +62,6 @@ ws2_32.lib;%(AdditionalDependencies) - 0x1e1D0000 diff --git a/PCbuild/_sqlite3.vcxproj b/PCbuild/_sqlite3.vcxproj index 5456bb5b238..1f1a1c8cada 100644 --- a/PCbuild/_sqlite3.vcxproj +++ b/PCbuild/_sqlite3.vcxproj @@ -64,9 +64,6 @@ $(sqlite3Dir);%(AdditionalIncludeDirectories) MODULE_NAME="sqlite3";%(PreprocessorDefinitions) - - 0x1e180000 - diff --git a/PCbuild/_testbuffer.vcxproj b/PCbuild/_testbuffer.vcxproj index 1f45b298102..fd2f320d797 100644 --- a/PCbuild/_testbuffer.vcxproj +++ b/PCbuild/_testbuffer.vcxproj @@ -60,11 +60,6 @@ <_ProjectFileVersion>10.0.40219.1 - - - 0x1e1F0000 - - diff --git a/PCbuild/_testcapi.vcxproj b/PCbuild/_testcapi.vcxproj index 365b07c5c5c..e668000bf2b 100644 --- a/PCbuild/_testcapi.vcxproj +++ b/PCbuild/_testcapi.vcxproj @@ -60,11 +60,6 @@ <_ProjectFileVersion>10.0.30319.1 - - - 0x1e1F0000 - - diff --git a/PCbuild/_testimportmultiple.vcxproj b/PCbuild/_testimportmultiple.vcxproj index 37c1a64ac8c..56da66cf327 100644 --- a/PCbuild/_testimportmultiple.vcxproj +++ b/PCbuild/_testimportmultiple.vcxproj @@ -60,11 +60,6 @@ <_ProjectFileVersion>10.0.30319.1 - - - 0x1e1F0000 - - diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj index 423e68c57b2..8b64e364f18 100644 --- a/PCbuild/python.vcxproj +++ b/PCbuild/python.vcxproj @@ -62,7 +62,6 @@ Console 2000000 - 0x1d000000 diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 25651d00049..c8a5d7d01b4 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -76,7 +76,6 @@ version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies) %(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName) - 0x1e000000 diff --git a/PCbuild/pythonw.vcxproj b/PCbuild/pythonw.vcxproj index e40f66c856b..19d64a332b2 100644 --- a/PCbuild/pythonw.vcxproj +++ b/PCbuild/pythonw.vcxproj @@ -58,7 +58,6 @@ 2000000 - 0x1d000000 diff --git a/PCbuild/select.vcxproj b/PCbuild/select.vcxproj index d6112ab6fe3..ea75705ae49 100644 --- a/PCbuild/select.vcxproj +++ b/PCbuild/select.vcxproj @@ -61,7 +61,6 @@ ws2_32.lib;%(AdditionalDependencies) - 0x1D110000 diff --git a/PCbuild/unicodedata.vcxproj b/PCbuild/unicodedata.vcxproj index 317c1a8a56d..b80da53af33 100644 --- a/PCbuild/unicodedata.vcxproj +++ b/PCbuild/unicodedata.vcxproj @@ -59,11 +59,6 @@ <_ProjectFileVersion>10.0.30319.1 - - - 0x1D120000 - - diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj index 9dbdc77335d..a796255c820 100644 --- a/PCbuild/xxlimited.vcxproj +++ b/PCbuild/xxlimited.vcxproj @@ -66,7 +66,6 @@ wsock32.lib;%(AdditionalDependencies) - 0x1D110000 diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index e88981fc3ab..2e468b7e57b 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -281,10 +281,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { case ID_INSTALL_BUTTON: SavePageSettings(); - if (!WillElevate() && !QueryElevateForCrtInstall()) { - break; - } - hr = BalGetNumericVariable(L"InstallAllUsers", &installAllUsers); ExitOnFailure(hr, L"Failed to get install scope"); @@ -332,10 +328,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { ReleaseStr(targetDir); } - if (!WillElevate() && !QueryElevateForCrtInstall()) { - break; - } - OnPlan(_command.action); break; @@ -2642,30 +2634,6 @@ private: return result; } - BOOL QueryElevateForCrtInstall() { - // Called to prompt the user that even though they think they won't need - // to elevate, they actually will because of the CRT install. - if (IsCrtInstalled()) { - // CRT is already installed - no need to prompt - return TRUE; - } - - LONGLONG elevated; - HRESULT hr = BalGetNumericVariable(L"WixBundleElevated", &elevated); - if (SUCCEEDED(hr) && elevated) { - // Already elevated - no need to prompt - return TRUE; - } - - LOC_STRING *locStr; - hr = LocGetString(_wixLoc, L"#(loc.ElevateForCRTInstall)", &locStr); - if (FAILED(hr)) { - BalLogError(hr, "Failed to get ElevateForCRTInstall string"); - return FALSE; - } - return ::MessageBoxW(_hWnd, locStr->wzText, _theme->sczCaption, MB_YESNO) != IDNO; - } - HRESULT EvaluateConditions() { HRESULT hr = S_OK; BOOL result = FALSE; diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets index e0dae21202e..f882d2ee1f0 100644 --- a/Tools/msi/bundle/bundle.targets +++ b/Tools/msi/bundle/bundle.targets @@ -71,6 +71,7 @@ + diff --git a/Tools/msi/bundle/packagegroups/crt.wxs b/Tools/msi/bundle/packagegroups/crt.wxs index dc4047590e8..61b756fc255 100644 --- a/Tools/msi/bundle/packagegroups/crt.wxs +++ b/Tools/msi/bundle/packagegroups/crt.wxs @@ -2,48 +2,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + ForcePerMachine="no" + InstallCondition="not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly"> + + - - - \ No newline at end of file diff --git a/Tools/msi/exe/exe.wxs b/Tools/msi/exe/exe.wxs index 03d43c60324..98d31b3a77b 100644 --- a/Tools/msi/exe/exe.wxs +++ b/Tools/msi/exe/exe.wxs @@ -3,10 +3,10 @@ - + - + @@ -14,7 +14,7 @@ - + diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat index 913512a778f..d66781d7c42 100644 --- a/Tools/msi/get_externals.bat +++ b/Tools/msi/get_externals.bat @@ -55,7 +55,7 @@ set binaries=%binaries% binutils set binaries=%binaries% gpg set binaries=%binaries% htmlhelp set binaries=%binaries% nuget -set binaries=%binaries% redist +set binaries=%binaries% redist-1 set binaries=%binaries% wix for %%b in (%binaries%) do ( diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index 0318f7aa8eb..0fe822af931 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -54,8 +54,8 @@ $(OutputPath)\ $(OutputPath) true - $(ExternalsDir)\windows-installer\redist - + $(ExternalsDir)\windows-installer\redist-1\$(Platform) + $([System.IO.Path]::GetFullPath($(CRTRedist))) python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm $(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0 @@ -123,10 +123,7 @@ tcltk - - redist - - + redist diff --git a/Tools/msi/ucrt/ucrt.wixproj b/Tools/msi/ucrt/ucrt.wixproj new file mode 100644 index 00000000000..52a7e0e672b --- /dev/null +++ b/Tools/msi/ucrt/ucrt.wixproj @@ -0,0 +1,28 @@ + + + + {E233091D-2EE3-49D8-A7F1-6E266CE1B6B1} + 2.0 + ucrt + Package + + + + + + + + + + + $(CRTRedist) + !(bindpath.redist)\ + $(CRTRedist)\ucrt + InstallDirectory\ + ucrt_dll + false + + + + + \ No newline at end of file diff --git a/Tools/msi/ucrt/ucrt.wxs b/Tools/msi/ucrt/ucrt.wxs new file mode 100644 index 00000000000..76e56820c53 --- /dev/null +++ b/Tools/msi/ucrt/ucrt.wxs @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Tools/msi/ucrt/ucrt_en-US.wxl b/Tools/msi/ucrt/ucrt_en-US.wxl new file mode 100644 index 00000000000..f42dd5fe44c --- /dev/null +++ b/Tools/msi/ucrt/ucrt_en-US.wxl @@ -0,0 +1,5 @@ + + + C Runtime Library + ucrt + diff --git a/Tools/msi/uploadrelease.proj b/Tools/msi/uploadrelease.proj index 96b99a4ff63..e70ae1de22f 100644 --- a/Tools/msi/uploadrelease.proj +++ b/Tools/msi/uploadrelease.proj @@ -21,7 +21,7 @@ - + $(MSITarget)