Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ contains a signed, multi-architecture
deployment. The duplicate GitHub Actions artifacts remain short-lived transport
and diagnostic copies.

For the all-zero proof only, MakeAppx assigns the outer bundle identity its
date/time-based version because it does not preserve `0.0.0.0` as a bundle
version. The two embedded architecture packages retain identity version
`0.0.0.0`; signing authorization verifies those versions and byte-compares both
embedded packages with the approved standalone inputs.

An `.msixbundle` is a single installable container for the x64 and ARM64 MSIX
packages; Windows selects the package appropriate for the device. An
`.appinstaller` file is separate update-channel metadata rather than an
Expand Down
9 changes: 8 additions & 1 deletion scripts/Build-MSIXBundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,16 @@ try {
-Destination (Join-Path $bundleInput 'OpenClawGateway-arm64.msix')

$resolvedMakeAppx = Resolve-MakeAppx
$bundleVersionArguments = @('/bv', $PackageVersion)
if ($PackageVersion -eq '0.0.0.0') {
# MakeAppx does not preserve an all-zero bundle identity version. Let
# it assign its date/time-based version while the embedded
# architecture packages retain the requested 0.0.0.0 identity.
$bundleVersionArguments = @()
}
& $resolvedMakeAppx bundle `
/v `
/bv $PackageVersion `
@bundleVersionArguments `
/d $bundleInput `
/p $resolvedOutputPath
if ($LASTEXITCODE -ne 0) {
Expand Down
15 changes: 15 additions & 0 deletions scripts/Test-Build-MSIXBundle.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ type nul > "%output%"
throw "MakeAppx did not receive the expected bundle version: $arguments"
}

$zeroBundle = Join-Path $testRoot 'OpenClawGateway-zero.msixbundle'
& $scriptPath `
-X64Package $x64Package `
-Arm64Package $arm64Package `
-PackageVersion '0.0.0.0' `
-OutputPath $zeroBundle `
-MakeAppxPath $fakeMakeAppx
$arguments = Get-Content -LiteralPath $makeAppxArguments -Raw
if ($arguments -match '/bv') {
throw "MakeAppx received an invalid all-zero bundle version: $arguments"
}
if (-not (Test-Path -LiteralPath $zeroBundle -PathType Leaf)) {
throw 'The zero-version bundle builder did not preserve MakeAppx output.'
}

Assert-Fails -MessagePattern 'must be different' -Action {
& $scriptPath `
-X64Package $x64Package `
Expand Down
6 changes: 4 additions & 2 deletions scripts/Test-SigningInputs.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ function New-TestBundle {

[string]$X64Package = (Join-Path `
$Root `
'x64\OpenClawGateway-x64.msix')
'x64\OpenClawGateway-x64.msix'),

[string]$BundleVersion = '2026.912.815.0'
)

$bundleDirectory = Join-Path $Root 'bundle'
Expand Down Expand Up @@ -226,7 +228,7 @@ function New-TestBundle {
<Bundle xmlns="http://schemas.microsoft.com/appx/2013/bundle">
<Identity Name="OpenClaw.Gateway"
Publisher="$($policy.publisher)"
Version="$approvedPackageVersion" />
Version="$BundleVersion" />
<Packages>
<Package Type="application"
Version="$approvedPackageVersion"
Expand Down
24 changes: 22 additions & 2 deletions scripts/Test-SigningInputs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,30 @@ try {
$bundleIdentity = $bundleManifest.SelectSingleNode(
"/*[local-name()='Bundle']/*[local-name()='Identity']"
)
$bundleVersion = if ($null -eq $bundleIdentity) {
''
}
else {
[string]$bundleIdentity.Version
}
$bundleVersionMatch = [regex]::Match(
$bundleVersion,
'^(?<major>\d+)\.(?<minor>\d+)\.(?<build>\d+)\.(?<revision>\d+)$'
)
$bundleVersionIsValid = $bundleVersionMatch.Success
if ($bundleVersionIsValid) {
foreach ($groupName in @('major', 'minor', 'build', 'revision')) {
if ([long]::Parse($bundleVersionMatch.Groups[$groupName].Value) -gt 65534) {
$bundleVersionIsValid = $false
break
}
}
}
if (
$null -eq $bundleIdentity -or
$bundleIdentity.Name -ne 'OpenClaw.Gateway' -or
$bundleIdentity.Publisher -ne $policy.publisher -or
$bundleIdentity.Version -ne $expectedPackageVersion
-not $bundleVersionIsValid
) {
throw 'The MSIX bundle manifest identity is unexpected.'
}
Expand Down Expand Up @@ -422,5 +441,6 @@ finally {

Write-Host (
"Authorized official signing for OpenClaw commit $approvedCommit " +
"and Gateway MSIX version $expectedPackageVersion."
"and Gateway MSIX version $expectedPackageVersion " +
"(bundle version $bundleVersion)."
)