How alex-spataru/qsimpleupdater works
QSimpleUpdater is a Qt-based reusable library, not an application. Its purpose is to let a host Qt app check a remote update manifest, compare versions, download an installer or package, and optionally hand control back to the host app for custom install logic.
Public API boundary
• The library’s public surface is concentrated in include/QSimpleUpdater.h.
• Consumers integrate it either through CMake (CMakeLists.txt, QSimpleUpdaterConfig.cmake.in) or qmake (QSimpleUpdater.pro, QSimpleUpdater.pri).
• The README’s examples indicate the main entry point is a singleton-style manager accessed by update-definition URL.
Core orchestration layer
• src/QSimpleUpdater.cpp is the top-level façade that application code talks to.
• It appears responsible for per-update-definition configuration such as enabling notifications, downloader behavior, module names/versions, and custom install procedures.
• Architecturally, this is the boundary between host application code and the update subsystem.
Per-update state and business logic
• src/Updater.cpp / src/Updater.h are the main stateful engine for a single update stream.
• The README’s “multiple modules” model strongly suggests each update manifest URL maps to one updater instance holding its own module metadata, version, and policy flags.
• This layer is where manifest parsing, version comparison, and update decision-making live.
Network-driven update flow
• The update flow is: fetch JSON manifest → read platform-specific entry → compare remote vs local version → decide whether to notify, download, or open a URL.
• The manifest schema in the README is the primary data contract with the server.
• Network transport is constrained to HTTP/HTTPS only, so the update subsystem is centered around remote file retrieval rather than general-purpose protocol handling.
Downloader and install path
• src/Downloader.cpp / src/Downloader.h plus src/Downloader.ui implement the built-in download UI and progress experience.
• This is the component that turns a remote download-url into a local file and signals completion.
• It is also the main handoff point for either automatic install behavior or custom install handling from the host application.
Authentication and access control
• src/AuthenticateDialog.cpp / .h / .ui provide a dedicated UI for authenticated downloads.
• This indicates the downloader supports protected endpoints and user credential entry, which is a separate concern from update logic itself.
Versioning subsystem
• Version comparison is a distinct concern and is explicitly covered by tests/Test_Versioning.h.
• The README shows semantic-version-aware behavior, including pre-release ordering and optional v prefix handling.
• This is important for architecture because “update available” is derived from version semantics, not just string comparison.
Platform-specific manifest routing
• The update definition file contains keys like windows, osx, linux, ios, and android, with support for custom platform keys.
• That means one manifest can serve multiple platforms while keeping platform-specific download URLs, open URLs, and changelogs.
• The platform-selection logic is a key decision point inside the updater engine.
Resource and packaging layer
• etc/resources/qsimpleupdater.qrc bundles library assets; etc/resources/version.rc.in suggests Windows version metadata integration.
• These files are part of the distribution/branding layer rather than the update algorithm itself.
Tutorial as reference host application
• tutorial/ is a sample Qt app that demonstrates integration and end-to-end behavior.
• It has its own UI (tutorial/src/Window.ui) and update manifest example (tutorial/definitions/updates.json).
• Architecturally, this is the consumer-side reference, showing how the library is embedded in a real application.
Tests and verification
• tests/ contains unit-style coverage for downloader behavior, updater behavior, public API behavior, and versioning.
• This suggests the repository treats the library as a set of independently testable subsystems rather than only integration-tested UI.
• tests/main.cpp and Tests.pro indicate a separate test executable.
Build, CI, and repository boundaries
• The repo supports both CMake and qmake, which matters for how the library is consumed and packaged.
• GitHub Actions (.github/workflows/main.yml) provides CI build validation.
• The project is structured as a library with optional tutorial/tests, not as a single monolithic executable.
Overall, the architecture is: host Qt app → public QSimpleUpdater API → per-URL Updater state and version logic → network fetch of JSON manifest → optional Downloader/AuthenticateDialog UI → downloaded file or custom install callback.
Main entry points: tests/main.cpp Test suite · Downloader.cpp Downloader · QSimpleUpdater.cpp Facade · src/main.cpp Tutorial app
Components 22
Public API
Headers and integration surfaces used by host Qt applications.
- QSimpleUpdater API · Main public entry point for consumers.
include/QSimpleUpdater.h - CMake build · CMake entrypoint for consumers and packaging.
CMakeLists.txt - qmake build · qmake project and .pri consumption path.
QSimpleUpdater.pro
Core Engine
Runtime orchestration, manifest handling, version decisions, and download flow.
- Facade · Top-level API object used by host applications.
src/QSimpleUpdater.cpp - Updater engine · Per-manifest state, policies, and update decisions.
src/Updater.cpp - Updater API · Public contract for the per-update stream engine.
src/Updater.h - Manifest flow · Fetches manifest data and selects platform-specific entries.
- Versioning · Semantic version comparison and release ordering.
tests/Test_Versioning.h
UI Flow
Dialogs and widgets used during authentication and downloading.
- Downloader · Downloads installer or package and tracks progress.
src/Downloader.cpp - Download UI · Built-in progress and download experience.
src/Downloader.ui - Auth dialog · Authentication prompt for protected downloads.
src/AuthenticateDialog.cpp - Auth UI · Credential entry form used by the downloader.
src/AuthenticateDialog.ui
Packaging
Build and resource files that package the library for consumption.
- CMake config · Generated package configuration template.
QSimpleUpdaterConfig.cmake.in - Library assets · Packaged UI assets and embedded resources.
etc/resources/qsimpleupdater.qrc - Windows metadata · Windows version and branding resource template.
etc/resources/version.rc.in
Examples
Tutorial host application demonstrating integration.
- Tutorial app · Reference Qt application showing integration.
tutorial/src/main.cpp - Tutorial window · Example host application window and integration code.
tutorial/src/Window.cpp - Sample manifest · Example update definition used by the tutorial.
tutorial/definitions/updates.json
Tests
Executable test coverage for the library subsystems.
- Test suite · Dedicated executable for library verification.
tests/main.cpp - API tests · Coverage for the public facade behavior.
tests/Test_QSimpleUpdater.h - Updater tests · Coverage for updater behavior and decisions.
tests/Test_Updater.h - Downloader tests · Coverage for download flow behavior.
tests/Test_Downloader.h
Connections 23
- QSimpleUpdater API → Facade: declares · Public header exposes the main library surface.
- Facade → Updater engine: creates/owns · Facade manages per-update updater instances.
- Facade → Manifest flow: coordinates · Top-level API triggers manifest retrieval and update checks.
- Updater engine → Manifest flow: uses · Updater parses manifests and selects the platform-specific payload.
- Manifest flow → Versioning: compares · Remote and local versions are compared to decide update availability.
- Manifest flow → Downloader: starts · When an update is accepted, the updater hands off to download.
- Downloader → Download UI: renders · Downloader presents the built-in progress UI.
- Downloader → Auth dialog: requests auth · Protected downloads route through the authentication dialog.
- Auth dialog → Auth UI: renders · Dialog UI gathers credentials.
- Downloader → Versioning: notifies · Download completion feeds into install/update decision flow.
- Tutorial app → Facade: consumes · Sample host application integrates the library through the facade.
- Tutorial app → Tutorial window: implements · Tutorial window contains the sample app behavior.
- Tutorial app → Sample manifest: uses · Sample app points at an example manifest.
- Test suite → API tests: runs · Test executable includes API coverage.
- Test suite → Updater tests: runs · Test executable includes updater coverage.
- Test suite → Downloader tests: runs · Test executable includes downloader coverage.
- Test suite → Versioning: verifies · Version semantics are validated separately.
- CMake build → QSimpleUpdater API: packages · CMake build exports the public header.
- qmake build → QSimpleUpdater API: packages · qmake build exposes the same public API.
- CMake config → CMake build: supports · Package config template supports CMake consumption.
- Library assets → Download UI: bundles · Resource bundle packages UI assets.
- Library assets → Auth UI: bundles · Resource bundle packages dialog assets.
- Windows metadata → Library assets: complements · Windows metadata complements packaged resources.