]> granicus.if.org Git - python/commitdiff
Allow Windows layout builds to fully skip code signing (GH-12808)
authorSteve Dower <steve.dower@microsoft.com>
Fri, 12 Apr 2019 18:24:15 +0000 (11:24 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Apr 2019 18:24:15 +0000 (11:24 -0700)
Tools/msi/make_cat.ps1
Tools/msi/sdktools.psm1

index 70741439869a7117616c276b4ad1f2399aef5045..cc3cd4a2b50cda16f8ee23079e1e1f8155b32069 100644 (file)
@@ -16,6 +16,7 @@
 #>
 param(
     [Parameter(Mandatory=$true)][string]$catalog,
+    [switch]$sign,
     [string]$description,
     [string]$certname,
     [string]$certsha1,
@@ -31,4 +32,6 @@ MakeCat $catalog
 if (-not $?) {
     throw "Catalog compilation failed"
 }
-Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
+if ($sign) {
+    Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
+}
index 61edb3411760c13d96fbb89845794d3c8a71d03a..8081b104d85a7fdd56e069f97a2aede59903f5ff 100644 (file)
@@ -31,6 +31,10 @@ function Sign-File {
         $certfile = $env:SigningCertificateFile;
     }
 
+    if (-not ($certsha1 -or $certname -or $certfile)) {
+        throw "No signing certificate specified"
+    }
+
     foreach ($a in $files) {
         if ($certsha1) {
             SignTool sign /sha1 $certsha1 /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
@@ -38,8 +42,6 @@ function Sign-File {
             SignTool sign /a /n $certname /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
         } elseif ($certfile) {
             SignTool sign /f $certfile /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
-        } else {
-            SignTool sign /a /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
         }
     }
 }