UpdateResult Struct

Platform Contract

#include <vortex/vupdate.h>

Public Members

bool ok { false }
std::string error
bool update_available { false }
std::string latest_version
std::string notes_url
std::string download_page
std::string download_url

Detailed Description

Result of one update check, read from the app's latest.json manifest.

A manifest names the newest release, and the download of each platform under its platform key:

{
    "version": "2.0.0",
    "notes_url": "https://example.com/app/changelog.html",
    "download_page": "https://example.com/app.html",
    "platforms": {
        "linux-x86_64": { "url": "https://example.com/app-2.0.0.tar.gz" },
        "windows-x86_64": { "url": "https://example.com/app-2.0.0.exe" }
    }
}

Only version is required, and other keys, like a download's sha256, are ignored. The result fills from the manifest like this:

Manifest key Member
version latest_version
notes_url notes_url
download_page download_page

download_url is the url of the platforms entry under this build's platform key. Without that entry, it's the download_page instead, so a prompt always has a link to open.

Member Variable Documentation

bool ok { false }

The manifest downloaded and parsed

std::string error

Why the check failed; "" when ok

bool update_available { false }

latest_version is newer than the app's

std::string latest_version

Like "2.0.0"

std::string notes_url

"" when the manifest has none

std::string download_page

"" when the manifest has none

std::string download_url

This platform's download, or download_page

› Documentation
Appearance
Theme
—