Update build files for ARM.

This commit is contained in:
Bruce
2026-04-12 23:00:10 +08:00
parent fc9aafd7ef
commit bc6ea5a8b0
2 changed files with 42 additions and 1 deletions

7
.gitignore vendored
View File

@@ -249,4 +249,9 @@ ModelManifest.xml
# Arm Build Files
package.zip
ArmPackage.zip
ArmPackage.zip
ArmBuild.ps1
arm_build.bat
ARM_PIE.pfx
UpgradeLog.htm

View File

@@ -18,6 +18,39 @@ function Copy-Binaries-ToDest($src, $dest)
}
}
function Sign-Files($directory)
{
$signtool = "C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe"
$pfx = Join-Path $root "Arm_PIE.pfx"
$pfxPassword = "" # 如果有密码请填写,例如 "123456"
$timestampUrl = "http://timestamp.digicert.com"
if (-not (Test-Path $signtool)) {
Write-Warning "signtool not found at $signtool, skipping signing"
return
}
if (-not (Test-Path $pfx)) {
Write-Warning "PFX file not found at $pfx, skipping signing"
return
}
$files = Get-ChildItem -Path $directory -Recurse -Include *.exe, *.dll
foreach ($file in $files) {
Write-Host "Signing $($file.FullName)..."
$filePath = $file.FullName
if ($pfxPassword) {
& $signtool sign /f $pfx /p $pfxPassword /fd SHA256 /tr $timestampUrl /td SHA256 /a "`"$filePath`""
} else {
& $signtool sign /f $pfx /fd SHA256 /tr $timestampUrl /td SHA256 /a "`"$filePath`""
}
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to sign $filePath (exit code: $LASTEXITCODE)"
# 如需停止脚本,取消下面一行的注释
# throw "Signing failed"
}
}
}
Write-Host "Preparing staging..."
# 清理旧的 staging
if (Test-Path $staging) { Remove-Item $staging -Recurse -Force }
@@ -50,6 +83,9 @@ if (Test-Path $shared) {
}
}
# 对最终目录中的所有 .exe 和 .dll 文件进行签名
Sign-Files $destRoot
Write-Host "Creating ZIP..."
if (Test-Path $outZip) { Remove-Item $outZip -Force }