build: add optional compact Windows release packaging

This commit is contained in:
cabbage committed 2026-10-27 15:43:51 +00:00
1 parent ee7844cb40
commit 789342ab4f
6 files changed
+114 -6

No files matched your search

+24
View File
@@ -89,6 +89,30 @@ dist/rvbox-1.0.0-rc.1/rvc-linux-ARCH --version
Replace `ARCH` with `amd64` or `arm64` for the Linux host. Both variants are
created from the same pinned toolchain and have the same embedded version.
For a compact, directly runnable Windows package, add
`--windows-compression upx` to that command. The default `none` retains the
ordinary executable. Compact builds use checksum-pinned UPX 5.2.1 with LZMA,
retain PE relocations, and leave icons/manifest/version resources uncompressed.
Packaging checks UPX integrity, compares every extracted Windows resource to
the original, and requires a smaller result before publication. The bundle
also retains `rvbox-windows-amd64-unpacked.exe`; both variants are included in
`SHA256SUMS`, and the manifest records `windows_compression`. Optional signing
runs **after** packing and signs both variants before checksumming. The packer
runs only inside Docker; release automatically rebuilds an older toolchain
that lacks it. Existing build-image/cache cleanup and recovery still apply.
UPX expands the image in memory at each process start, including service, tray,
launcher, and signal-helper modes. This trades smaller files/downloads for
startup work and reduced sharing of executable memory between processes.
Antivirus products may flag packed executables; use the unpacked fallback if
that occurs rather than weakening protection. Resource/integrity checks are
not native execution evidence. Before choosing compressed packages for regular
distribution, exercise fresh install, upgrade, same-version activation, service
restart/reboot, tray, and ordinary/elevated command execution on Windows.
The installer still needs no external extractor or separate resident process.
See the [UPX manual](https://github.com/upx/upx/blob/v5.2.1/doc/upx.pod) and
[upstream antivirus issue](https://github.com/upx/upx/issues/437).
For a Windows-signed release, provide an executable host-side signing hook via
`--sign-windows-hook /absolute/path/to/hook`. The wrapper invokes it with the
Windows executable path and version, then records `windows_signed: true` in the