File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,10 +187,11 @@ public override bool Execute() {
187187 <SdkBinPath Condition =" !Exists($(SdkBinPath))" >$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86</SdkBinPath >
188188 <SdkBinPath Condition =" !Exists($(SdkBinPath))" >$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\</SdkBinPath >
189189 <_SignCommand Condition =" Exists($(SdkBinPath)) and '$(SigningCertificate)' != '' and $(SupportSigning)" >"$(SdkBinPath)\signtool.exe" sign /q /a /n "$(SigningCertificate)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand >
190+ <_SignCommand Condition =" Exists($(SdkBinPath)) and '$(SigningCertificateSha1)' != '' and $(SupportSigning)" >"$(SdkBinPath)\signtool.exe" sign /q /a /sha1 "$(SigningCertificateSha1)" /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d "Python $(PythonVersion)"</_SignCommand >
190191 <_MakeCatCommand Condition =" Exists($(SdkBinPath))" >"$(SdkBinPath)\makecat.exe"</_MakeCatCommand >
191192 </PropertyGroup >
192-
193- <Target Name =" _SignBuild" AfterTargets =" AfterBuild" Condition =" '$(SigningCertificate )' != '' and $(SupportSigning)" >
193+
194+ <Target Name =" _SignBuild" AfterTargets =" AfterBuild" Condition =" '$(_SignCommand )' != '' and $(SupportSigning)" >
194195 <Error Text =" Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition =" '$(_SignCommand)' == ''" />
195196 <Exec Command =' $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError =" false" />
196197 </Target >
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ function Sign-File {
2121 $description = " Python" ;
2222 }
2323 }
24+ if (-not $certsha1 ) {
25+ $certsha1 = $env: SigningCertificateSha1 ;
26+ }
2427 if (-not $certname ) {
2528 $certname = $env: SigningCertificate ;
2629 }
@@ -32,7 +35,7 @@ function Sign-File {
3235 if ($certsha1 ) {
3336 SignTool sign / sha1 $certsha1 / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
3437 } elseif ($certname ) {
35- SignTool sign / n $certname / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
38+ SignTool sign / a / n $certname / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
3639 } elseif ($certfile ) {
3740 SignTool sign / f $certfile / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
3841 } else {
You can’t perform that action at this time.
0 commit comments