[Python-checkins] cpython (merge 3.5 -> default): Issue 24476: Statically links vcruntime140.dll and removes it from the installer

steve.dower python-checkins at python.org
Fri Jun 19 22:09:25 CEST 2015


https://hg.python.org/cpython/rev/c0827842102e
changeset:   96620:c0827842102e
parent:      96618:af793c7580f1
parent:      96619:56ea535a8047
user:        Steve Dower <steve.dower at microsoft.com>
date:        Fri Jun 19 13:08:58 2015 -0700
summary:
  Issue 24476: Statically links vcruntime140.dll and removes it from the installer

files:
  PCbuild/pyproject.props                                      |   8 +-
  Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp |   2 -
  Tools/msi/bundle/bundle.targets                              |   1 -
  Tools/msi/bundle/packagegroups/crt.wxs                       |  19 ----
  Tools/msi/crt/crt.wixproj                                    |  20 ----
  Tools/msi/crt/crt.wxs                                        |  26 -----
  Tools/msi/crt/crt_en-US.wxl                                  |   5 -
  Tools/msi/crt/crt_files.wxs                                  |  20 ----
  Tools/msi/crt/crtlicense.txt                                 |  47 ----------
  Tools/msi/exe/crtlicense.txt                                 |   7 +-
  10 files changed, 7 insertions(+), 148 deletions(-)


diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -32,7 +32,7 @@
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling></ExceptionHandling>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <WarningLevel>Level3</WarningLevel>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
@@ -43,7 +43,7 @@
     <ClCompile Condition="$(Configuration) == 'Debug'">
       <Optimization>Disabled</Optimization>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
     </ClCompile>
     <Link>
       <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -53,7 +53,9 @@
       <RandomizedBaseAddress>true</RandomizedBaseAddress>
       <DataExecutionPrevention>true</DataExecutionPrevention>
       <SuppressStartupBanner>true</SuppressStartupBanner>
-      <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+      <AdditionalDependencies Condition="$(Configuration) == 'Debug'">ucrtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies Condition="$(Configuration) != 'Debug'">ucrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <IgnoreSpecificDefaultLibraries>LIBC;libucrt.lib;libucrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
       <TargetMachine>MachineX86</TargetMachine>
       <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine>
       <ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase>
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -2402,8 +2402,6 @@
         // Check whether at least CRT v10.0.9924.0 is available.
         // It should only be installed as a Windows Update package, which means
         // we don't need to worry about 32-bit/64-bit.
-        // However, since the WU package does not include vcruntime140.dll, we
-        // still install that ourselves.
         LPCWSTR crtFile = L"api-ms-win-crt-runtime-l1-1-0.dll";
 
         DWORD cbVer = GetFileVersionInfoSizeW(crtFile, nullptr);
diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets
--- a/Tools/msi/bundle/bundle.targets
+++ b/Tools/msi/bundle/bundle.targets
@@ -61,7 +61,6 @@
     </ItemDefinitionGroup>
     <ItemGroup>
         <Package Include="..\core\core*.wixproj" />
-        <Package Include="..\crt\crt*.wixproj" />
         <Package Include="..\dev\dev*.wixproj" />
         <Package Include="..\doc\doc*.wixproj" />
         <Package Include="..\exe\exe*.wixproj" />
diff --git a/Tools/msi/bundle/packagegroups/crt.wxs b/Tools/msi/bundle/packagegroups/crt.wxs
--- a/Tools/msi/bundle/packagegroups/crt.wxs
+++ b/Tools/msi/bundle/packagegroups/crt.wxs
@@ -6,25 +6,6 @@
             <PackageGroupRef Id="crt_14.0_v6.1" />
             <PackageGroupRef Id="crt_14.0_v6.2" />
             <PackageGroupRef Id="crt_14.0_v6.3" />
-
-            <MsiPackage Id="crt_AllUsers"
-                        SourceFile="crt.msi"
-                        Compressed="$(var.CompressMSI)"
-                        DownloadUrl="$(var.DownloadUrl)"
-                        ForcePerMachine="yes"
-                        InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
-                <!-- TARGETDIR will be ignored, but must still be provided -->
-                <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
-            </MsiPackage>
-            
-            <MsiPackage Id="crt_JustForMe"
-                        SourceFile="crt.msi"
-                        Compressed="$(var.CompressMSI)"
-                        DownloadUrl="$(var.DownloadUrl)"
-                        ForcePerMachine="no"
-                        InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip)">
-                <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
-            </MsiPackage>
         </PackageGroup>
     </Fragment>
 
diff --git a/Tools/msi/crt/crt.wixproj b/Tools/msi/crt/crt.wixproj
deleted file mode 100644
--- a/Tools/msi/crt/crt.wixproj
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-    <PropertyGroup>
-        <ProjectGuid>{91C99298-8E2E-4422-A5AF-CC4FFF9A58D3}</ProjectGuid>
-        <SchemaVersion>2.0</SchemaVersion>
-        <OutputName>crt</OutputName>
-        <OutputType>Package</OutputType>
-        <SuppressIces>ICE71</SuppressIces>
-    </PropertyGroup>
-    <Import Project="..\msi.props" />
-    <ItemGroup>
-        <Compile Include="crt.wxs" />
-        <Compile Include="crt_files.wxs" />
-    </ItemGroup>
-    <ItemGroup>
-        <EmbeddedResource Include="*.wxl" />
-    </ItemGroup>
-    
-    <Import Project="..\msi.targets" />
-</Project>
\ No newline at end of file
diff --git a/Tools/msi/crt/crt.wxs b/Tools/msi/crt/crt.wxs
deleted file mode 100644
--- a/Tools/msi/crt/crt.wxs
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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" />
-        
-        <?if $(var.Platform)~=x64 ?>
-        <?define DirName=System64?>
-        <?else ?>
-        <?define DirName=System?>
-        <?endif ?>
-        <DirectoryRef Id="TARGETDIR">
-            <Directory Id="$(var.DirName)Folder" Name="$(var.DirName)">
-                <Directory Id="SystemInstallDirectory" Name="." />
-            </Directory>
-        </DirectoryRef>
-        <?undef DirName ?>
-        
-        <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
-            <ComponentGroupRef Id="crt_files" />
-        </Feature>
-    </Product>
-</Wix>
-
diff --git a/Tools/msi/crt/crt_en-US.wxl b/Tools/msi/crt/crt_en-US.wxl
deleted file mode 100644
--- a/Tools/msi/crt/crt_en-US.wxl
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
-    <String Id="Descriptor">C Runtime</String>
-    <String Id="ShortDescriptor">crt</String>
-</WixLocalization>
diff --git a/Tools/msi/crt/crt_files.wxs b/Tools/msi/crt/crt_files.wxs
deleted file mode 100644
--- a/Tools/msi/crt/crt_files.wxs
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-    <Fragment>
-        <?if $(var.Platform)~=x64 ?>
-        <?define vcruntime140Guid={B33258FD-750C-3B42-8BE4-535B48E97DB4}?>
-        <?else ?>
-        <?define vcruntime140Guid={E8E39D3B-4F35-36D8-B892-4B28336FE041}?>
-        <?endif ?>
-        <ComponentGroup Id="crt_files">
-            <Component Id="vcruntime140.dll_LM" Directory="SystemInstallDirectory" Guid="$(var.vcruntime140Guid)" Shared="yes" SharedDllRefCount="yes">
-                <Condition>ALLUSERS=1</Condition>
-                <File Id="vcruntime140.dll_LM" Source="!(bindpath.crt)\vcruntime140.dll" />
-            </Component>
-            <Component Id="vcruntime140.dll_CU" Directory="InstallDirectory" Guid="*">
-                <Condition>NOT ALLUSERS=1</Condition>
-                <File Id="vcruntime140.dll_CU" Source="!(bindpath.crt)\vcruntime140.dll" />
-            </Component>
-        </ComponentGroup>
-    </Fragment>
-</Wix>
diff --git a/Tools/msi/crt/crtlicense.txt b/Tools/msi/crt/crtlicense.txt
deleted file mode 100644
--- a/Tools/msi/crt/crtlicense.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-Additional Conditions for this Windows binary build
----------------------------------------------------
-
-This program is linked with and uses Microsoft Distributable Code,
-copyrighted by Microsoft Corporation. The Microsoft Distributable Code
-includes the following files:
-
-appcrt140.dll
-desktopcrt140.dll
-vcruntime140.dll
-msvcp140.dll
-concrt140.dll
-vccorlib140.dll
-
-If you further distribute programs that include the Microsoft
-Distributable Code, you must comply with the restrictions on
-distribution specified by Microsoft. In particular, you must require
-distributors and external end users to agree to terms that protect the
-Microsoft Distributable Code at least as much as Microsoft's own
-requirements for the Distributable Code. See Microsoft's documentation
-(included in its developer tools and on its website at microsoft.com)
-for specific details.
-
-Redistribution of the Windows binary build of the Python interpreter
-complies with this agreement, provided that you do not:
-
-- alter any copyright, trademark or patent notice in Microsoft's
-Distributable Code;
-
-- use Microsoft's trademarks in your programs' names or in a way that
-suggests your programs come from or are endorsed by Microsoft;
-
-- distribute Microsoft's Distributable Code to run on a platform other
-than Microsoft operating systems, run-time technologies or application
-platforms; or
-
-- include Microsoft Distributable Code in malicious, deceptive or
-unlawful programs.
-
-These restrictions apply only to the Microsoft Distributable Code as
-defined above, not to Python itself or any programs running on the
-Python interpreter. The redistribution of the Python interpreter and
-libraries is governed by the Python Software License included with this
-file, or by other licenses as marked.
-
diff --git a/Tools/msi/exe/crtlicense.txt b/Tools/msi/exe/crtlicense.txt
--- a/Tools/msi/exe/crtlicense.txt
+++ b/Tools/msi/exe/crtlicense.txt
@@ -5,11 +5,8 @@
 
 This program is linked with and uses Microsoft Distributable Code,
 copyrighted by Microsoft Corporation. The Microsoft Distributable Code
-includes the following files:
-
-msvcr90.dll
-msvcp90.dll
-msvcm90.dll
+is embedded in each .exe, .dll and .pyd file as a result of running
+the code through a linker.
 
 If you further distribute programs that include the Microsoft
 Distributable Code, you must comply with the restrictions on

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list