blob: 70741439869a7117616c276b4ad1f2399aef5045 [file] [log] [blame]
Steve Dower0cd63912018-12-10 18:52:57 -08001<#
2.Synopsis
3 Compiles and signs a catalog file.
4.Description
5 Given the CDF definition file, builds and signs a catalog.
6.Parameter catalog
7 The path to the catalog definition file to compile and
8 sign. It is assumed that the .cat file will be the same
9 name with a new extension.
10.Parameter description
11 The description to add to the signature (optional).
12.Parameter certname
13 The name of the certificate to sign with (optional).
14.Parameter certsha1
15 The SHA1 hash of the certificate to sign with (optional).
16#>
17param(
18 [Parameter(Mandatory=$true)][string]$catalog,
19 [string]$description,
20 [string]$certname,
21 [string]$certsha1,
22 [string]$certfile
23)
24
25$tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent;
26Import-Module $tools\sdktools.psm1 -WarningAction SilentlyContinue -Force
27
28Set-Alias MakeCat (Find-Tool "makecat.exe") -Scope Script
29
30MakeCat $catalog
31if (-not $?) {
32 throw "Catalog compilation failed"
33}
34Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')