File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -185,10 +185,11 @@ public override bool Execute() {
185
185
<SdkBinPath Condition =" !Exists($(SdkBinPath))" >$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Kits\Installed Roots@KitsRoot)\bin\x86</SdkBinPath >
186
186
<SdkBinPath Condition =" !Exists($(SdkBinPath))" >$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.1A@InstallationFolder)\Bin\</SdkBinPath >
187
187
<_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 >
188
+ <_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 >
188
189
<_MakeCatCommand Condition =" Exists($(SdkBinPath))" >"$(SdkBinPath)\makecat.exe"</_MakeCatCommand >
189
190
</PropertyGroup >
190
-
191
- <Target Name =" _SignBuild" AfterTargets =" AfterBuild" Condition =" '$(SigningCertificate )' != '' and $(SupportSigning)" >
191
+
192
+ <Target Name =" _SignBuild" AfterTargets =" AfterBuild" Condition =" '$(_SignCommand )' != '' and $(SupportSigning)" >
192
193
<Error Text =" Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition =" '$(_SignCommand)' == ''" />
193
194
<Exec Command =' $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError =" false" />
194
195
</Target >
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ function Sign-File {
21
21
$description = " Python" ;
22
22
}
23
23
}
24
+ if (-not $certsha1 ) {
25
+ $certsha1 = $env: SigningCertificateSha1 ;
26
+ }
24
27
if (-not $certname ) {
25
28
$certname = $env: SigningCertificate ;
26
29
}
@@ -32,7 +35,7 @@ function Sign-File {
32
35
if ($certsha1 ) {
33
36
SignTool sign / sha1 $certsha1 / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
34
37
} 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
36
39
} elseif ($certfile ) {
37
40
SignTool sign / f $certfile / fd sha256 / t http:// timestamp.verisign.com / scripts/ timestamp.dll / d $description $a
38
41
} else {
You can’t perform that action at this time.
0 commit comments