summaryrefslogtreecommitdiffstats
path: root/Tools/msi/sign_build.ps1
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2018-12-11 02:52:57 (GMT)
committerGitHub <noreply@github.com>2018-12-11 02:52:57 (GMT)
commit0cd6391fd890368ea1743dac50c366b42f2fd126 (patch)
tree1e2d8fd6c85a08477d3eb4082badd9a50386e63e /Tools/msi/sign_build.ps1
parent1c3de541e64f75046b20cdd27bada1557e550bcd (diff)
downloadcpython-0cd6391fd890368ea1743dac50c366b42f2fd126.zip
cpython-0cd6391fd890368ea1743dac50c366b42f2fd126.tar.gz
cpython-0cd6391fd890368ea1743dac50c366b42f2fd126.tar.bz2
bpo-34977: Add Windows App Store package (GH-11027)
Also adds the PC/layout script for generating layouts on Windows.
Diffstat (limited to 'Tools/msi/sign_build.ps1')
-rw-r--r--Tools/msi/sign_build.ps134
1 files changed, 34 insertions, 0 deletions
diff --git a/Tools/msi/sign_build.ps1 b/Tools/msi/sign_build.ps1
new file mode 100644
index 0000000..6668eb3
--- /dev/null
+++ b/Tools/msi/sign_build.ps1
@@ -0,0 +1,34 @@
+<#
+.Synopsis
+ Recursively signs the contents of a directory.
+.Description
+ Given the file patterns, code signs the contents.
+.Parameter root
+ The root directory to sign.
+.Parameter patterns
+ The file patterns to sign
+.Parameter description
+ The description to add to the signature (optional).
+.Parameter certname
+ The name of the certificate to sign with (optional).
+.Parameter certsha1
+ The SHA1 hash of the certificate to sign with (optional).
+#>
+param(
+ [Parameter(Mandatory=$true)][string]$root,
+ [string[]]$patterns=@("*.exe", "*.dll", "*.pyd"),
+ [string]$description,
+ [string]$certname,
+ [string]$certsha1,
+ [string]$certfile
+)
+
+$tools = $script:MyInvocation.MyCommand.Path | Split-Path -parent;
+Import-Module $tools\sdktools.psm1 -WarningAction SilentlyContinue -Force
+
+pushd $root
+try {
+ Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files (gci -r $patterns)
+} finally {
+ popd
+} \ No newline at end of file