Registry Mirror
Skip to content

Latest commit

 

History

History
28 lines (15 loc) · 4.71 KB

updates.md

File metadata and controls

28 lines (15 loc) · 4.71 KB

In-app updates

Profiled checks GitHub Releases for MBllcode/Profiled on startup and every six hours. Open About to check manually. A newer signed stable release appears in the dashboard sidebar. Read the release notes, download the update, and choose Install and restart. End any active profile and finish editing first. Profiled remains usable offline. An unavailable update feed does not block startup or profile commands.

The first copy with self-updates must be downloaded from GitHub and opened manually. The production public key is pinned in Profiled.Desktop.csproj (ProfiledUpdatePublicKey), so local and CI builds trust the same signed releases; a build may override it with -p:ProfiledUpdatePublicKey=.... Builds without a key can still be used and updated by replacing the EXE manually. Supported installs use a writable folder on a local Windows drive that supports atomic file replacement. The updater runs with the current user's permissions.

Configure stable releases

Before publishing the first stable release with this workflow, generate a dedicated RSA 3072-bit or 4096-bit key on a trusted machine. Store a secure offline backup of the private key.

  • Set GitHub repository Actions variable PROFILED_UPDATE_PUBLIC_KEY to the base64-encoded DER SubjectPublicKeyInfo public key.
  • Set GitHub repository Actions secret PROFILED_UPDATE_SIGNING_KEY to the base64-encoded DER PKCS#8 private key. The secret is used only by the release-signing step.

In PowerShell 7, System.Security.Cryptography.RSA.Create(3072) creates a suitable key. Export the public and private DER forms with ExportSubjectPublicKeyInfo() and ExportPkcs8PrivateKey(), respectively, then use Convert.ToBase64String on each. Transfer the private value directly into approved secret storage and keep it out of source control, shell history, logs and release artifacts.

The existing tag workflow builds the self-contained EXE with the public key in assembly metadata. Stable releases publish Profiled.exe and Profiled-win-x64.zip plus a detached signature (Profiled-update.sig) and its exact UTF-8 manifest bytes (Profiled-update.json). Signing fails if the private key does not match the configured public key. Prereleases retain the normal EXE and ZIP and are ignored by the updater. Supported installed versions can upgrade directly to any newer signed stable release that uses the same key and manifest schema. A replacement signing key requires distributing a build with the new trust anchor manually before it can receive releases signed with that key.

Update protocol

The signed schema binds the repository, stable version, exact asset name, file length and SHA-256 digest. The app verifies RSA-PSS with SHA-256 against its pinned public key before showing the update. It verifies the signed bytes again during download and checks the executable before staging and replacement. HTTPS requests are restricted to GitHub's API and release asset hosts. Release notes are rendered as text.

The normal process starts a temporary copy of its own executable in --update mode, then shuts down through the existing tray and application cleanup. The helper confirms the old process and binary, waits for exit, and replaces the installed EXE atomically with a backup on the same volume. It starts Profiled at the same path and waits for the normal desktop startup and WebView UI to acknowledge readiness. If replacement fails or the updated process exits or misses the startup deadline, the helper restores and restarts the previous executable. Successful startup and rollback remove their temporary files. If Windows prevents restoration itself, the backup remains in the adjacent update staging folder. A power loss during replacement may also leave that folder for manual recovery.

Settings and profiles remain in the existing application data folder. The install restart opens the desktop for validation without activating a startup profile. Later launches use the existing startup configuration and shortcut targets. The mechanism authenticates update artifacts for Profiled. It does not replace Windows Authenticode signing or protect against software that already controls the current user or signing key.

Verification

Use two differently versioned, single-file builds sharing a test public key. Serve the newer build and its signed manifest from an isolated release feed, or use a controlled GitHub test release with the production feed. Check version ordering, unsigned and tampered metadata, changed/truncated payloads, no network at startup, active profiles, install directory permissions, interrupted downloads, starting another instance during replacement, and successful restart and rollback at the original executable path. Keep test signing keys separate from production.