mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-13 20:28:33 +10:00
Update build files for ARM.
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -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
|
||||
36
ArmBuild.ps1
36
ArmBuild.ps1
@@ -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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user