]> granicus.if.org Git - python/commitdiff
Issue #28402: Adds signed catalog files for stdlib on Windows.
authorSteve Dower <steve.dower@microsoft.com>
Mon, 10 Oct 2016 03:18:52 +0000 (20:18 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Mon, 10 Oct 2016 03:18:52 +0000 (20:18 -0700)
Misc/NEWS
PCbuild/pyproject.props
Tools/msi/common.wxs
Tools/msi/lib/lib.wixproj
Tools/msi/lib/lib.wxs
Tools/msi/lib/lib_files.wxs
Tools/msi/msi.props
Tools/msi/msi.targets
Tools/msi/tools/tools.wixproj
Tools/msi/tools/tools.wxs
Tools/msi/tools/tools_files.wxs

index bb4f02928c03061951a8ba34f8cfa3a8c94d7506..388a75760a57e8791b9445d54ea5d1bb1b1b1d3e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -226,6 +226,8 @@ Library
 Windows
 -------
 
+- Issue #28402: Adds signed catalog files for stdlib on Windows.
+
 - Issue #28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by
   Eryk Sun)
 
index 543b4ca2080c4ec47e3029c71f24858796d4dbb3..7012170e0c7aa42e1018f5b541f193eb2a2ef492 100644 (file)
@@ -147,11 +147,13 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
              Targets="CleanAll" />
   </Target>
 
-  <PropertyGroup Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
-    <SignToolPath Condition="'$(SignToolPath)' == '' or !Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86\signtool.exe</SignToolPath>
-    <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86\signtool.exe</SignToolPath>
-    <SignToolPath Condition="!Exists($(SignToolPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\signtool.exe</SignToolPath>
-    <_SignCommand Condition="Exists($(SignToolPath))">"$(SignToolPath)" sign /q /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand>
+  <PropertyGroup>
+    <SdkBinPath Condition="'$(SdkBinPath)' == '' or !Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot10)\bin\x86</SdkBinPath>
+    <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot81)\bin\x86</SdkBinPath>
+    <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86</SdkBinPath>
+    <SdkBinPath Condition="!Exists($(SdkBinPath))">$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\</SdkBinPath>
+    <_SignCommand Condition="Exists($(SdkBinPath)) and '$(SigningCertificate)' != '' and $(SupportSigning)">"$(SdkBinPath)\signtool.exe" sign /q /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand>
+    <_MakeCatCommand Condition="Exists($(SdkBinPath))">"$(SdkBinPath)\makecat.exe"</_MakeCatCommand>
   </PropertyGroup>
   
   <Target Name="_SignBuild" AfterTargets="AfterBuild" Condition="'$(SigningCertificate)' != '' and $(SupportSigning)">
index 1949e81c04616b13cedc9ce1087358ad6cace272..398d94a24d554f8327ab0f5805f5b2877423c297 100644 (file)
@@ -63,7 +63,9 @@
     <!-- Top-level directories -->
     <Fragment>
         <DirectoryRef Id="InstallDirectory">
-            <Directory Id="DLLs" Name="DLLs" />
+            <Directory Id="DLLs" Name="DLLs">
+                <Directory Id="Catalogs" />
+            </Directory>
         </DirectoryRef>
     </Fragment>
 
index 64e58787b88e0b576fb505fe0bd1ab77ef0ca56c..26311ea32724d10f3234bd4d395ff6e948292a13 100644 (file)
@@ -27,6 +27,7 @@
             <TargetBase>$(PySourcePath)Lib</TargetBase>
             <Target_>Lib\</Target_>
             <Group>lib_py</Group>
+            <IncludeInCat>true</IncludeInCat>
         </InstallFiles>
     </ItemGroup>
     
index 2b04bcb3049c48df06dae5f7d0298b3303b33136..2a3b9ecfeef8d01147092f8afb02455e008e3667 100644 (file)
@@ -11,6 +11,7 @@
             <ComponentGroupRef Id="lib_py" />
             <ComponentGroupRef Id="lib_files" />
             <ComponentGroupRef Id="lib_extensions" />
+            <ComponentGroupRef Id="lib_cat" />
             <ComponentRef Id="OptionalFeature" />
         </Feature>
     </Product>
index 804ab0146d3d11032fd546f361180cbfc18f1442..eb26f8d29d9d2028b596243e6f0003ddf63ccd12 100644 (file)
             </Component>
         </ComponentGroup>
     </Fragment>
+    <Fragment>
+        <ComponentGroup Id="lib_cat">
+            <Component Id="lib_cat" Directory="Catalogs" Guid="*">
+                <File Name="python_lib.cat" KeyPath="yes" />
+            </Component>
+        </ComponentGroup>
+    </Fragment>
 </Wix>
index 745fc541175dc8e7c6e7101e102b300be57c53b9..60abba1f7bef865fed1c6b89692c94d67352e262 100644 (file)
@@ -11,6 +11,7 @@
         <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
         <Platform Condition="'$(Platform)' == ''">x86</Platform>
         <InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
+        <_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat</_MakeCatCommand>
     </PropertyGroup>
 
     <Import Project="wix.props" />
             <Group>generated_filelist</Group>
             <Condition></Condition>
             <DiskId></DiskId>
+            <IncludeInCat>false</IncludeInCat>
         </InstallFiles>
         <LinkerBindInputPaths>
             <Visible>false</Visible>
index 86be35badb7be0f954cfb7eabcbd37d474a64df5..9283a1ed6c3049ea5f5f293cfded89ef9104d4ae 100644 (file)
                 <_Source>%(Source)$([msbuild]::MakeRelative(%(SourceBase), %(FullPath)))</_Source>
                 <_Target>%(Target_)$([msbuild]::MakeRelative(%(TargetBase), %(FullPath)))</_Target>
             </InstallFiles>
+            
+            <_CatalogFiles Include="@(InstallFiles)" Condition="%(InstallFiles.IncludeInCat) and ''!=$([System.IO.File]::ReadAllText(%(InstallFiles.FullPath)))" />
         </ItemGroup>
-        
+
         <WriteLinesToFile File="$(_FileListTarget)" Lines="@(InstallFiles->'&quot;%(_Source)&quot;,&quot;%(_Target)&quot;,&quot;%(Group)&quot;,&quot;%(DiskId)&quot;,&quot;%(Condition)&quot;')" Overwrite="true" />
         <Exec Command='"$(PythonExe)" csv_to_wxs.py "$(_FileListTarget)" "$(_InstallFilesTarget)"'
               WorkingDirectory="$(MSBuildThisFileDirectory)" />
         </ItemGroup>
     </Target>
 
+    <Target Name="GenerateCatalog" AfterTargets="ProcessInstallFiles" Condition="'@(_CatalogFiles)' != ''">
+        <PropertyGroup>
+            <_CatFileSourceTarget>$(IntermediateOutputPath)$(MSBuildProjectName).cdf</_CatFileSourceTarget>
+            <_CatFileTarget>$(IntermediateOutputPath)python_$(MSBuildProjectName).cat</_CatFileTarget>
+            <_CatFile>[CatalogHeader]
+Name=$([System.IO.Path]::GetFileName($(_CatFileTarget)))
+ResultDir=$([System.IO.Path]::GetDirectoryName($(_CatFileTarget)))
+PublicVersion=1
+CatalogVersion=2
+HashAlgorithms=SHA256
+PageHashes=false
+EncodingType=
+
+[CatalogFiles]
+@(_CatalogFiles->'&lt;HASH&gt;%(Filename)%(Extension)=%(FullPath)','
+')
+</_CatFile>
+        </PropertyGroup>
+
+        <WriteLinesToFile File="$(_CatFileSourceTarget)" Lines="$(_CatFile)" Overwrite="true" />
+        <Exec Command='$(_MakeCatCommand) "$(_CatFileSourceTarget)"' WorkingDirectory="$(MSBuildThisFileDirectory)" />
+        <Exec Command='$(_SignCommand) "$(_CatFileTarget)"' WorkingDirectory="$(MSBuildThisFileDirectory)"
+              Condition="Exists($(_CatFileTarget)) and '$(_SignCommand)' != ''" />
+
+        <ItemGroup>
+            <FileWrites Include="$(_CatFileSourceTarget);$(_CatFileTarget)" />
+        </ItemGroup>
+    </Target>
+
     <Target Name="_TransformWxlTemplates" AfterTargets="PrepareForBuild" Inputs="@(WxlTemplate);$(PySourcePath)include\patchlevel.h" Outputs="$(IntermediateOutputPath)%(Filename).wxl">
         <PropertyGroup Condition="'@(WxlTemplate)' != ''">
             <_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)$(PyTestExt)`).Replace(`{{LongVersion}}`, `$(PythonVersion)$(PyTestExt)`).Replace(`{{Bitness}}`, `$(Bitness)`))</_Content>
index f43cf3309e9b1cdf48d99d6278714db6586687b2..b7fc41ee92e6d8880f783c3d299572ac6949cf9d 100644 (file)
@@ -36,6 +36,7 @@
                 <TargetBase>$(PySourcePath)</TargetBase>
                 <Target_></Target_>
                 <Group>tools_py</Group>
+                <IncludeInCat>true</IncludeInCat>
         </InstallFiles>
     </ItemGroup>
     
index 8f8418a46c2d36864698653522c94cb7695900a8..7a805d0612e080523e1d11e0b519ea1f4d270b30 100644 (file)
@@ -9,6 +9,7 @@
         <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
             <ComponentGroupRef Id="tools_py" />
             <ComponentGroupRef Id="tools_scripts" />
+            <ComponentGroupRef Id="tools_cat" />
             <ComponentRef Id="OptionalFeature" />
         </Feature>
     </Product>
index 3ae0db2e1fd36c0ba709a5ba41d88978c9d526e7..9c76b1b44460abc4447e592de83e94938b4565c2 100644 (file)
             </Component>
         </ComponentGroup>
     </Fragment>
+    <Fragment>
+        <ComponentGroup Id="tools_cat">
+            <Component Id="tools_cat" Directory="Catalogs" Guid="*">
+                <File Name="python_tools.cat" KeyPath="yes" />
+            </Component>
+        </ComponentGroup>
+    </Fragment>
 </Wix>