mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-21 02:09:25 +08:00
* windows: sign the setup engine so smart app control can run setup
Setup extracts a copy of its engine to %TEMP% at launch and writes the
installed uninstaller from the same bytes. Signing only the outer
hex-setup-*.exe left both unsigned, and Windows 11 Smart App Control
blocked the extracted copy ("Unable to execute file in the temporary
directory", error 4551).
SignedUninstaller embeds the engine's signature, but the signature has to
exist before the compile that uses it, and the compile job holds no
credentials. So the release signs it in two passes: the new
windows-setup-engine.yml compiles once with SignedUninstaller=yes and keeps
the unsigned uninst-*.e32 ISCC asks to be signed (ISCC leaves it and aborts
as a compile failure, exit 2); sign-windows-engine signs and verifies it in
the release environment; windows-installers.yml then compiles with the
signed engine and asserts the installed uninstaller's signature.
Test builds and runs without the Azure values keep the unsigned single
compile. Inno Setup is pinned to 6.7.1, read from the compiler's own banner
(ISCC.exe's version resource is 0.0.0), so both passes use one compiler.
* windows: harden the setup engine passes
Review fixes for the signed setup engine:
- sign-windows-engine requires sign-windows to have succeeded, and its
steps are unguarded like sign-windows-installers, so it can never upload
an empty digest.
- setup-engine runs only when Windows is signed (it waits for
sign-windows), so unsigned runs really do a single compile with no
engine pass at all.
- the Inno re-pin uses choco upgrade --allow-downgrade, because choco
install --version treats a preinstalled package as already installed.
- Invoke-Iscc collects native stderr safely under Windows PowerShell 5.1
and pwsh with $PSNativeCommandUseErrorActionPreference on, and echoes
the compiler's lines so build logs stay readable.
- the version probe compiles a minimal script from standard input into a
throwaway OutputDir, so it never touches the caller's -OutDir.
- only .e32 exists for the engine; drop the unused .e64 handling.
- the uninstaller signature test also checks the release publisher, and
the test-builds doc warns that Smart App Control cannot be turned back
on without resetting Windows.
* windows: correct the setup engine comments