[Python-checkins] bpo-32507: Change Windows install to include app-local UCRT (#5119)

Steve Dower webhook-mailer at python.org
Tue Jan 9 03:14:51 EST 2018


https://github.com/python/cpython/commit/d135f20ae8887acc7716561bc8f4c7eb6d58d24c
commit: d135f20ae8887acc7716561bc8f4c7eb6d58d24c
branch: master
author: Steve Dower <steve.dower at microsoft.com>
committer: GitHub <noreply at github.com>
date: 2018-01-09T19:14:46+11:00
summary:

bpo-32507: Change Windows install to include app-local UCRT (#5119)

files:
A Misc/NEWS.d/next/Windows/2018-01-07-12-32-49.bpo-32507.vB4gxk.rst
A Misc/NEWS.d/next/Windows/2018-01-07-12-33-21.bpo-29911.ewSJKb.rst
A Tools/msi/ucrt/ucrt.wixproj
A Tools/msi/ucrt/ucrt.wxs
A Tools/msi/ucrt/ucrt_en-US.wxl
D PC/dllbase_nt.txt
M PCbuild/_bz2.vcxproj
M PCbuild/_ctypes.vcxproj
M PCbuild/_decimal.vcxproj
M PCbuild/_elementtree.vcxproj
M PCbuild/_msi.vcxproj
M PCbuild/_multiprocessing.vcxproj
M PCbuild/_overlapped.vcxproj
M PCbuild/_socket.vcxproj
M PCbuild/_sqlite3.vcxproj
M PCbuild/_testbuffer.vcxproj
M PCbuild/_testcapi.vcxproj
M PCbuild/_testimportmultiple.vcxproj
M PCbuild/python.vcxproj
M PCbuild/pythoncore.vcxproj
M PCbuild/pythonw.vcxproj
M PCbuild/select.vcxproj
M PCbuild/unicodedata.vcxproj
M PCbuild/xxlimited.vcxproj
M Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
M Tools/msi/bundle/bundle.targets
M Tools/msi/bundle/packagegroups/crt.wxs
M Tools/msi/exe/exe.wxs
M Tools/msi/get_externals.bat
M Tools/msi/msi.props
M Tools/msi/uploadrelease.proj

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
- - <unused>                  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 @@
       <PreprocessorDefinitions>WIN32;_FILE_OFFSET_BITS=64;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
-    <Link>
-      <BaseAddress>0x1D170000</BaseAddress>
-    </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_bz2module.c" />
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 @@
       <AdditionalIncludeDirectories>..\Modules\_ctypes\libffi_msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
-      <BaseAddress>0x1D1A0000</BaseAddress>
       <AdditionalOptions>/EXPORT:DllGetClassObject,PRIVATE /EXPORT:DllCanUnloadNow,PRIVATE %(AdditionalOptions)</AdditionalOptions>
     </Link>
   </ItemDefinitionGroup>
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 @@
       <PreprocessorDefinitions Condition="'$(Platform)' == 'x64'">CONFIG_64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
-    <Link>
-      <BaseAddress>0x1D1A0000</BaseAddress>
-    </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\_decimal\libmpdec\basearith.h" />
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 @@
       <AdditionalIncludeDirectories>..\Modules\expat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;USE_PYEXPAT_CAPI;XML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <Link>
-      <BaseAddress>0x1D100000</BaseAddress>
-    </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\expat\ascii.h" />
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 @@
   <ItemDefinitionGroup>
     <Link>
       <AdditionalDependencies>cabinet.lib;msi.lib;rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1D160000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <ItemDefinitionGroup>
     <Link>
       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1e1D0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <ItemDefinitionGroup>
     <Link>
       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <ItemDefinitionGroup>
     <Link>
       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1e1D0000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
       <AdditionalIncludeDirectories>$(sqlite3Dir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>MODULE_NAME="sqlite3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
-    <Link>
-      <BaseAddress>0x1e180000</BaseAddress>
-    </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\_sqlite\cache.h" />
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 @@
   <PropertyGroup>
     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
   </PropertyGroup>
-  <ItemDefinitionGroup>
-    <Link>
-      <BaseAddress>0x1e1F0000</BaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_testbuffer.c" />
   </ItemGroup>
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 @@
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
   </PropertyGroup>
-  <ItemDefinitionGroup>
-    <Link>
-      <BaseAddress>0x1e1F0000</BaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_testcapimodule.c" />
   </ItemGroup>
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 @@
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
   </PropertyGroup>
-  <ItemDefinitionGroup>
-    <Link>
-      <BaseAddress>0x1e1F0000</BaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\Modules\_testimportmultiple.c" />
   </ItemGroup>
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 @@
     <Link>
       <SubSystem>Console</SubSystem>
       <StackReserveSize>2000000</StackReserveSize>
-      <BaseAddress>0x1d000000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
     <Link>
       <AdditionalDependencies>version.lib;shlwapi.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(PySourcePath)PC\external\$(PlatformToolset)\$(ArchName)</AdditionalLibraryDirectories>
-      <BaseAddress>0x1e000000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <ItemDefinitionGroup>
     <Link>
       <StackReserveSize>2000000</StackReserveSize>
-      <BaseAddress>0x1d000000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <ItemDefinitionGroup>
     <Link>
       <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@
   <PropertyGroup>
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
   </PropertyGroup>
-  <ItemDefinitionGroup>
-    <Link>
-      <BaseAddress>0x1D120000</BaseAddress>
-    </Link>
-  </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="..\Modules\unicodedata_db.h" />
     <ClInclude Include="..\Modules\unicodename_db.h" />
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 @@
     </ClCompile>
     <Link>
       <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <BaseAddress>0x1D110000</BaseAddress>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
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 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
         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 @@
         <Package Include="..\tcltk\tcltk*.wixproj" />
         <Package Include="..\test\test*.wixproj" />
         <Package Include="..\tools\tools*.wixproj" />
+        <Package Include="..\ucrt\ucrt*.wixproj" />
     </ItemGroup>
     
     <PropertyGroup>
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 @@
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
     <Fragment>
         <PackageGroup Id="crt">
-            <PackageGroupRef Id="crt_14.0_v6.0" />
-            <PackageGroupRef Id="crt_14.0_v6.1" />
-            <PackageGroupRef Id="crt_14.0_v6.2" />
-            <PackageGroupRef Id="crt_14.0_v6.3" />
-        </PackageGroup>
-    </Fragment>
-
-    <?foreach ver in v6.0;v6.1;v6.2;v6.3 ?>
-    <?if "$(var.ver)" = "v6.0" ?>
-    <?define msuver=6.0 ?>
-    <?elseif "$(var.ver)" = "v6.1" ?>
-    <?define msuver=6.1 ?>
-    <?elseif "$(var.ver)" = "v6.2" ?>
-    <?define msuver=8-RT ?>
-    <?elseif "$(var.ver)" = "v6.3" ?>
-    <?define msuver=8.1 ?>
-    <?else ?>
-    <?error unknown version $(var.ver) ?>
-    <?endif ?>
-
-    <Fragment>
-        <PackageGroup Id="crt_14.0_$(var.ver)">
-            <MsuPackage Id="crt_14.0_$(var.ver)_x86"
-                        KB="2999226"
-                        SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x86.msu"
-                        DisplayName="!(loc.CRTDescription)"
-                        Description="!(loc.CRTDescription)"
+            <MsiPackage Id="ucrt_AllUsers"
+                        SourceFile="ucrt.msi"
                         Compressed="$(var.CompressMSI)"
                         DownloadUrl="$(var.DownloadUrl)"
-                        InstallCondition="not CRTInstalled and VersionNT = $(var.ver) and not VersionNT64 and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />
-
-            <MsuPackage Id="crt_14.0_$(var.ver)_x64"
-                        KB="2999226"
-                        SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x64.msu"
-                        DisplayName="!(loc.CRTDescription)"
-                        Description="!(loc.CRTDescription)"
+                        ForcePerMachine="yes"
+                        InstallCondition="InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
+                <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+            </MsiPackage>
+            <MsiPackage Id="ucrt_JustForMe"
+                        SourceFile="ucrt.msi"
                         Compressed="$(var.CompressMSI)"
                         DownloadUrl="$(var.DownloadUrl)"
-                        InstallCondition="not CRTInstalled and VersionNT64 = $(var.ver) and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />
+                        ForcePerMachine="no"
+                        InstallCondition="not InstallAllUsers and not CRTInstalled and (Include_core or Include_exe or Include_pip) and not LauncherOnly">
+                <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+            </MsiPackage>
         </PackageGroup>
     </Fragment>
-
-    <?undef msuver ?>
-    <?endforeach ?>
 </Wix>
\ 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 @@
     <Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
         <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
-        
+
         <PropertyRef Id="UpgradeTable" />
         <PropertyRef Id="REGISTRYKEY" />
-        
+
         <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
             <ComponentGroupRef Id="exe_python" Primary="yes" />
             <ComponentGroupRef Id="exe_reg" Primary="yes" />
@@ -14,7 +14,7 @@
             <ComponentGroupRef Id="exe_icons" />
             <ComponentRef Id="OptionalFeature" />
         </Feature>
-            
+
         <Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
             <ComponentGroupRef Id="exe_python" />
             <Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
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 Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
         <OutDir>$(OutputPath)</OutDir>
         <ReuseCabinetCache>true</ReuseCabinetCache>
-        <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist</CRTRedist>
-        <CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
+        <CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist-1\$(Platform)</CRTRedist>
+        <CRTRedist>$([System.IO.Path]::GetFullPath($(CRTRedist)))</CRTRedist>
         <DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
 
         <InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
@@ -123,10 +123,7 @@
         <LinkerBindInputPaths Include="$(tcltkDir)">
             <BindName>tcltk</BindName>
         </LinkerBindInputPaths>
-        <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
-            <BindName>redist</BindName>
-        </LinkerBindInputPaths>
-        <LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT">
+        <LinkerBindInputPaths Include="$(CRTRedist)">
             <BindName>redist</BindName>
         </LinkerBindInputPaths>
         <LinkerBindInputPaths Include="$(BuildPath32)">
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+    <PropertyGroup>
+        <ProjectGuid>{E233091D-2EE3-49D8-A7F1-6E266CE1B6B1}</ProjectGuid>
+        <SchemaVersion>2.0</SchemaVersion>
+        <OutputName>ucrt</OutputName>
+        <OutputType>Package</OutputType>
+    </PropertyGroup>
+    <Import Project="..\msi.props" />
+    <ItemGroup>
+        <Compile Include="ucrt.wxs" />
+    </ItemGroup>
+    <ItemGroup>
+        <EmbeddedResource Include="*.wxl" />
+    </ItemGroup>
+    <ItemGroup>
+        <InstallFiles Include="$(CRTRedist)\ucrt\*.dll">
+            <SourceBase>$(CRTRedist)</SourceBase>
+            <Source>!(bindpath.redist)\</Source>
+            <TargetBase>$(CRTRedist)\ucrt</TargetBase>
+            <Target_>InstallDirectory\</Target_>
+            <Group>ucrt_dll</Group>
+            <IncludeInCat>false</IncludeInCat>
+        </InstallFiles>
+    </ItemGroup>
+    
+    <Import Project="..\msi.targets" />
+</Project>
\ 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+    <Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
+        <Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+        
+        <PropertyRef Id="UpgradeTable" />
+        <PropertyRef Id="REGISTRYKEY" />
+        
+        <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
+            <ComponentGroupRef Id="ucrt_dll" />
+        </Feature>
+    </Product>
+</Wix>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+    <String Id="Descriptor">C Runtime Library</String>
+    <String Id="ShortDescriptor">ucrt</String>
+</WixLocalization>
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 @@
     </PropertyGroup>
     
     <ItemGroup>
-        <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu">
+        <File Include="$(OutputPath)\*.msi">
             <CopyTo>$(MSITarget)</CopyTo>
         </File>
         <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip">



More information about the Python-checkins mailing list