Repository navigation
EN Portable Updater
updater/ is a standalone native Win32 updater that builds into a single FlowWeaverUpdater.exe. It downloads, verifies and extracts an update bundle, then starts the Inno Setup installer in normal interactive mode so files and registry entries are upgraded by the installer itself.
- Single static binary: no .NET, Java, Python, Node or VC++ runtime.
- No child processes:
cmd.exe,powershell.exe,reg.exe,tar.exeand7z.exeare never invoked. - Built-in
net/httpdownloader (HTTPS, timeouts, retries, Range resume),archive/zipextraction, SHA-256, Ed25519 manifest signatures and optional Authenticode verification. - Process management, elevation, exit-code handling and delayed replacement all use Win32 APIs.
.\build_windows.ps1 -Build all -SilentA plain build is enough, no extra switch. Every Windows GUI target also compiles the matching FlowWeaverUpdater.exe, writes an updater.json and places both in build\bin\gui\Windows\<arch>\.
Or build it on its own:
$env:GOOS='windows'; $env:CGO_ENABLED='0'
go build -trimpath -ldflags "-s -w" -o build/bin/updater/Windows/x64/FlowWeaverUpdater.exe ./updaterOutput: build/bin/updater/Windows/<arch>/FlowWeaverUpdater.exe. The build-windows CI job builds all three architectures and stages flowweaver-<version>-windows-<arch>-update.zip (Inno installer + updater) plus updater-manifest-<arch>.json. With the UPDATER_ED25519_SEED secret configured it also produces updater-manifest-<arch>.json.sig and updater-public-key.txt.
FlowWeaverUpdater.exe
updater.json
See updater/updater.example.json in the repository. Required fields: manifest_url (HTTPS), public_key (base64 Ed25519 key), app_id (must match the Inno AppId), arch and channel. The app_id differs per architecture: the three fixed GUIDs for x64, x86 and arm64 live in the CI script and must not be mixed.
Logs go to updater.log next to the executable (falling back to %TEMP%\flowweaver-updater\), temporary files to updater-work-* in the same directory, removed after a successful update.
- Read the local version: uninstall
DisplayVersion→Package.appxmanifest→version.txt. - Fetch and verify the Ed25519-signed manifest, compare version and channel.
- Download the zip, check SHA-256, extract in-process, locate
setup.exe, verify its MZ header and hash. - Prompt the user to save work →
WM_CLOSEold processes → ask before force-terminating survivors. -
ShellExecuteExW(runas)with an emptylpParameters: no/SILENT,/VERYSILENTor/SUPPRESSMSGBOXES. -
WaitForSingleObject+GetExitCodeProcess, handling Inno exit codes 0–8. - On success verify the registry version and clean up; on failure keep the download and log. The updater never modifies installed files itself, so the old version stays runnable.
When the updater lives inside the install directory it copies itself to %TEMP% and resumes as a separate process to avoid file locks. A manifest updater.name entry schedules a delayed self-replacement via MoveFileExW(DELAY_UNTIL_REBOOT).
Windows updates no longer generate or launch any script. The GUI looks for FlowWeaverUpdater.exe next to the application and starts it with ShellExecuteW (-config pointing at the sibling updater.json); the updater performs the download, signature check and extraction, then starts the Inno Setup installer in normal interactive mode. On installations that predate the updater, the .exe asset falls back to runas with a normal installer UI; portable zip/7z assets now report that the installer must be downloaded manually. cmd.exe, powershell.exe, tar.exe and 7z.exe are no longer part of the update path.
The installer, the portable zip and the MSIX package all ship FlowWeaverUpdater.exe together with an updater.json (manifest URL, per-architecture AppId, Ed25519 public key), because every artifact is packed from the GUI output folder. After extracting the portable archive the application and the updater sit side by side, so the in-app update starts the updater directly. The updater inside the MSIX is signed with the package, but a sandboxed app still cannot download and execute new files at runtime, so MSIX updates stay with the store.
After the release is published, the publish job signs in to the announcement backend and posts a notice: POST https://jetcpp.ccwu.cc/api/admin/session for a token, then POST https://jetcpp.ccwu.cc/api/notices?product=flowweaver. The notice carries Chinese, English and Russian titles and bodies, an important/info level, the publication time and an external link to the concrete release page. The notice id is release-<tag>, so a repeated release replaces the previous notice instead of piling up. The credentials live in repository secrets (ANNOUNCEMENT_ADMIN_EMAIL, ANNOUNCEMENT_ADMIN_PASSWORD); when they are missing the step is skipped and the release is unaffected.
The CI also needs the UPDATER_ED25519_SEED secret (32-byte base64 manifest signing seed).
Stable AppId (one {AppId}_is1 uninstall entry), PrivilegesRequired=admin (avoid PrivilegesRequiredOverridesAllowed=dialog, which can create both HKLM and HKCU uninstall entries), UsePreviousAppDir=yes, CloseApplications=yes, RestartApplications=no, Uninstallable=yes, [Files] Flags: ignoreversion overwritereadonly restartreplace, and a [Registry] section for version and install path. See docs/inno-setup-upgrade.iss.example and docs/portable-updater.md in the repository.