hex/.github/release/verify-authenticode.ps1
Dax 6958927696
Windows: hex.com console entry point beside the GUI hex.exe (#1374)
* Windows: ship hex.com, a console entry point beside the GUI hex.exe, on PATH

* lock, fmt, legacy adoption

* clippy

* build hex-console in its own cargo run: -p hex is ambiguous with the hex crate

* hex.com returns once the app starts; Ctrl+C only; install script and Setup replace a running hex.com; hex-console checks in Compile

* fmt

* installer test: exit 0 once every check passed
2026-11-05 06:52:51 -05:00

24 lines
1.1 KiB
PowerShell

# Checks the Authenticode signatures CI applied through Azure Artifact
# Signing to every executable (.exe and hex.com) and installer in the given
# folders. Run after
# both the executables and the installers are signed.
#
# .github/release/verify-authenticode.ps1 -Folders work
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string[]]$Folders
)
$ErrorActionPreference = 'Stop'
$files = @($Folders | ForEach-Object { Get-ChildItem -LiteralPath $_ | Where-Object Extension -in '.exe', '.com' })
if ($files.Count -eq 0) { throw "No executables in $($Folders -join ', ')." }
foreach ($file in $files) {
$signature = Get-AuthenticodeSignature -LiteralPath $file.FullName
if ($signature.Status -ne 'Valid') {
throw "$($file.Name) is not validly signed: $($signature.Status) $($signature.StatusMessage)"
}
# Artifact Signing certificates last days; only the timestamp keeps
# the signature valid afterwards.
if (-not $signature.TimeStamperCertificate) { throw "$($file.Name) has no RFC 3161 timestamp." }
Write-Output "ok - $($file.Name) signed by $($signature.SignerCertificate.Subject)"
}