Add compression estimates, transparent image output and full format selection

This commit is contained in:
nordik committed 2026-10-27 01:25:00 +01:00
1 parent 65cebb31ca
commit 2b897267d1
22 files changed
+220 -30

No files matched your search

+5 -1
View File
@@ -6,6 +6,7 @@ param(
[string]$SdkBin
)
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot 'hash-file.ps1')
$projectRoot = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
if (-not $IdentityFile) { $IdentityFile = Join-Path $projectRoot $(if ($Channel -eq 'Store') { 'store\identity.store.json' } else { 'store\identity.dev.json' }) }
$identity = Get-Content -LiteralPath $IdentityFile -Raw | ConvertFrom-Json
@@ -70,6 +71,9 @@ $packLog = Join-Path $projectRoot "build\makeappx-$Channel.log"
if ($LASTEXITCODE -ne 0) { throw 'MakeAppx-Validierung fehlgeschlagen.' }
$certificatePath = $null
if ($SignDevelopment) {
# Load Windows modules explicitly when the parent shell supplies a different PSModulePath.
Import-Module (Join-Path $PSHOME 'Modules\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.psd1') -ErrorAction Stop
Import-Module (Join-Path $env:WINDIR 'System32\WindowsPowerShell\v1.0\Modules\PKI\PKI.psd1') -ErrorAction Stop
$certificate = Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Subject -eq $identity.Publisher -and $_.FriendlyName -eq 'FileBow local development' -and $_.HasPrivateKey -and $_.NotAfter -gt (Get-Date).AddDays(7) } | Select-Object -First 1
if (-not $certificate) {
$certificate = New-SelfSignedCertificate -Type Custom -Subject $identity.Publisher -FriendlyName 'FileBow local development' -CertStoreLocation Cert:\CurrentUser\My -KeyUsage DigitalSignature -KeyExportPolicy NonExportable -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.3','2.5.29.19={text}') -NotAfter (Get-Date).AddYears(1)
@@ -79,6 +83,6 @@ if ($SignDevelopment) {
$certificatePath = Join-Path $outputDir 'FileBow-Development.cer'
Export-Certificate -Cert $certificate -FilePath $certificatePath -Force | Out-Null
}
$record = @{ Channel=$Channel; Package=$package; Stage=$stage; Identity=$identity; Signed=[bool]$SignDevelopment; Certificate=$certificatePath; SHA256=(Get-FileHash $package -Algorithm SHA256).Hash; BuiltAt=(Get-Date).ToUniversalTime().ToString('o') }
$record = @{ Channel=$Channel; Package=$package; Stage=$stage; Identity=$identity; Signed=[bool]$SignDevelopment; Certificate=$certificatePath; SHA256=(Get-FileBowSha256 $package); BuiltAt=(Get-Date).ToUniversalTime().ToString('o') }
$record | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $outputDir "build-$Channel.json") -Encoding utf8
Write-Output $package