Skip to content

Commit 606c66a

Browse files
authored
Allow Windows layout builds to fully skip code signing (GH-12808)
1 parent f4e5661 commit 606c66a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Tools/msi/make_cat.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#>
1717
param(
1818
[Parameter(Mandatory=$true)][string]$catalog,
19+
[switch]$sign,
1920
[string]$description,
2021
[string]$certname,
2122
[string]$certsha1,
@@ -31,4 +32,6 @@ MakeCat $catalog
3132
if (-not $?) {
3233
throw "Catalog compilation failed"
3334
}
34-
Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
35+
if ($sign) {
36+
Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
37+
}

Tools/msi/sdktools.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ function Sign-File {
3131
$certfile = $env:SigningCertificateFile;
3232
}
3333

34+
if (-not ($certsha1 -or $certname -or $certfile)) {
35+
throw "No signing certificate specified"
36+
}
37+
3438
foreach ($a in $files) {
3539
if ($certsha1) {
3640
SignTool sign /sha1 $certsha1 /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
3741
} elseif ($certname) {
3842
SignTool sign /a /n $certname /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
3943
} elseif ($certfile) {
4044
SignTool sign /f $certfile /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
41-
} else {
42-
SignTool sign /a /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
4345
}
4446
}
4547
}

0 commit comments

Comments
 (0)