vupdate.h Header
Types
| struct | UpdateOptions | Where the manifest lives + which platform entry names this build's artifact. The desktop runner publishes these through the platform->app env channel (the "base_url" pattern) under the env keys below; update_options() reads them back, so shell wiring and app code share one source. |
| struct | UpdateResult | The outcome of one manifest check. ok covers transport + parse; update_available is the version comparison's verdict (meaningful only when ok). download_url is the platform entry's url when the manifest carries one for this build's key, else the manifest's download_page — so a prompt always has SOMETHING to hand to open_url when an update exists. |
Type Aliases
| using | UpdateCallback |
Functions
| int | compare_versions(const std::string & a, const std::string & b) |
| bool | parse_update_manifest(const std::string & body, const std::string & platformKey, UpdateResult & out) |
| UpdateOptions | update_options(const VApp & app) |
| void | check_for_updates(VApp & app, const UpdateOptions & opts, UpdateCallback cb) |
Type Alias Documentation
using UpdateCallback = std::function<void (const UpdateResult &)>
No description available.
Function Documentation
int compare_versions(const std::string & a, const std::string & b)
SemVer-ish ordering: negative when a < b, zero when equal, positive when a > b. Dotted numeric cores compare component-wise (missing components read 0), a release outranks its own prereleases ("2.0.0" > "2.0.0-alpha.1"), prerelease identifiers compare per SemVer (dot-split; numeric identifiers compare numerically and order below alphanumeric ones, which compare lexically; more identifiers ranks higher when the shared prefix ties). A leading 'v' and any "+build" metadata are ignored.
bool parse_update_manifest(const std::string & body, const std::string & platformKey, UpdateResult & out)
Parse a latest.json manifest body into out (schema in
vortex/plans/08-desktop-update-channel.md). Fills latest_version /
notes_url / download_page / download_url; does NOT set ok or compare
versions — check_for_updates composes that. Returns false (out.error set)
on malformed JSON or a missing "version". Exposed for headless tests.
UpdateOptions update_options(const VApp & app)
Read the runner-published UpdateOptions back off env(). An empty manifestUrl means the feature is off (nothing was published).
void check_for_updates(VApp & app, const UpdateOptions & opts, UpdateCallback cb)
GET the manifest via app.http(), parse it, and compare against app.app_version(); the result is delivered on the UI thread (the http seam's contract). Stamps kUpdateLastCheckKey on every completed attempt, success or not, so cadence logic can throttle a persistently failing endpoint. Fails (ok=false) without touching the network when opts.manifestUrl is empty or the app never set a version — misconfiguration surfaces to the manual-check path, never guessed around. Skip-version filtering is deliberately NOT applied here: the prompt layer owns it, so a manual "Check for updates" can still surface a release the user skipped.