mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 20:57:22 +02:00
[Tool] Script to build an installer locally (#39017)
* add script to build a installer * minor fix * fix search path for msix file * fix sign * fix sign * fix spelling * Fix powershell5 can't recognize emoji * ensure-wix * bring cmdpal available during local build * remove early quit * fix marco * add logger * doc * add a note * self review * fix macro def * add functionality to export cert so that other machine can install it. * spelling
This commit is contained in:
29
tools/build/cert-sign-package.ps1
Normal file
29
tools/build/cert-sign-package.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
param (
|
||||
[string]$certSubject = "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US",
|
||||
[string[]]$TargetPaths = "C:\PowerToys\ARM64\Release\WinUI3Apps\CmdPal\AppPackages\Microsoft.CmdPal.UI_0.0.1.0_Test\Microsoft.CmdPal.UI_0.0.1.0_arm64.msix"
|
||||
)
|
||||
|
||||
. "$PSScriptRoot\cert-management.ps1"
|
||||
$cert = EnsureCertificate -certSubject $certSubject
|
||||
|
||||
if (-not $cert) {
|
||||
Write-Error "Failed to prepare certificate."
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Certificate ready: $($cert.Thumbprint)"
|
||||
|
||||
if (-not $TargetPaths -or $TargetPaths.Count -eq 0) {
|
||||
Write-Error "No target files provided to sign."
|
||||
exit 1
|
||||
}
|
||||
|
||||
foreach ($filePath in $TargetPaths) {
|
||||
if (-not (Test-Path $filePath)) {
|
||||
Write-Warning "Skipping: File does not exist - $filePath"
|
||||
continue
|
||||
}
|
||||
|
||||
Write-Host "Signing: $filePath"
|
||||
& signtool sign /sha1 $($cert.Thumbprint) /fd SHA256 /t http://timestamp.digicert.com "$filePath"
|
||||
}
|
||||
Reference in New Issue
Block a user