sign-package.ps1 878 B

1234567891011121314151617181920212223242526272829
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # Run this script on a Windows host in a CMake single-config build tree.
  4. param (
  5. [string]$signtool = 'signtool',
  6. [string]$cpack = 'bin\cpack',
  7. [switch]$trace
  8. )
  9. if ($trace -eq $true) {
  10. Set-PSDebug -Trace 1
  11. }
  12. $ErrorActionPreference = 'Stop'
  13. # Sign binaries with SHA-1 for Windows 7 and below.
  14. & $signtool sign -v -a -t http://timestamp.digicert.com -fd sha1 bin\*.exe
  15. # Sign binaries with SHA-256 for Windows 8 and above.
  16. & $signtool sign -v -a -tr http://timestamp.digicert.com -fd sha256 -td sha256 -as bin\*.exe
  17. # Create packages.
  18. & $cpack -G ZIP
  19. & $cpack -G WIX
  20. # Sign installer with SHA-256.
  21. & $signtool sign -v -a -tr http://timestamp.digicert.com -fd sha256 -td sha256 -d "CMake Windows Installer" cmake-*-win*.msi