From 864d38482c03ef9c4d9409d81481abc40219c231 Mon Sep 17 00:00:00 2001 From: Lin Zhang Date: Sun, 4 Oct 2026 19:22:35 +0800 Subject: [PATCH] fix(release): mark the Windows ARM64 MSI as Arm64 jpackage (WiX 3.11) writes x64;1033 as the platform of every MSI, while the ARM64 package embeds jpackage's ARM64 custom action DLL (wixhelper.dll). Windows Installer runs that DLL in its x64 custom action host, which can't load it, so installing fails with error 1723 ("A DLL required for this install to complete could not be run"). Retarget the package to Arm64 with schema 500 after jpackage builds it, so the DLL runs natively. --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6dc91b80..c71f61ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -227,6 +227,33 @@ jobs: ${{ matrix.portable && ':app:desktop:packageReleasePortableZip' || '' }} -PVERSION_NAME=${KETCH_VERSION#v} + # jpackage marks every MSI as x64, yet the ARM64 one carries jpackage's ARM64 custom action + # DLL. Windows Installer runs it in an x64 host, which can't load it, so installing fails + # with error 1723. Marking the package Arm64 (Windows Installer 5.0) runs it natively. + - name: Mark the MSI as Arm64 + if: matrix.os == 'windows' && matrix.arch == 'arm64' + shell: pwsh + run: | + $msi = (Get-ChildItem app/desktop/build/compose/binaries/main-release -Recurse -Filter *.msi).FullName + function Call($target, $name, $flags, $arguments) { + $target.GetType().InvokeMember($name, $flags, $null, $target, $arguments) + } + $installer = New-Object -ComObject WindowsInstaller.Installer + $database = Call $installer OpenDatabase InvokeMethod @($msi, 1) # msiOpenDatabaseModeTransact + $summary = Call $database SummaryInformation GetProperty @(2) + $template = Call $summary Property GetProperty @(7) + if (-not $template.StartsWith('x64;')) { throw "Unexpected MSI platform: $template" } + Call $summary Property SetProperty @(7, ($template -replace '^x64;', 'Arm64;')) + Call $summary Property SetProperty @(14, 500) # Minimum installer version + Call $summary Persist InvokeMethod @() + Call $database Commit InvokeMethod @() + [void][Runtime.InteropServices.Marshal]::ReleaseComObject($summary) + [void][Runtime.InteropServices.Marshal]::ReleaseComObject($database) + $saved = Call $installer OpenDatabase InvokeMethod @($msi, 0) # msiOpenDatabaseModeReadOnly + $check = Call (Call $saved SummaryInformation GetProperty @(0)) Property GetProperty @(7) + if (-not $check.StartsWith('Arm64;')) { throw "MSI platform is still $check" } + Write-Output "$msi now targets $check" + - name: Rename artifact run: | SRC=$(find app/desktop/build/compose/binaries/main-release -name "*.${{ matrix.ext }}")