An object to check for and download new releases through GitHub.
More...
#include <updater.h>
An object to check for and download new releases through GitHub.
◆ Updater() [1/3]
Nickvision::Update::Updater::Updater |
( |
std::string | githubRepoUrl | ) |
|
Constructs an Updater.
- Parameters
-
githubRepoUrl | The url of the GitHub repo to fetch updates for |
- Exceptions
-
std::invalid_argument | Thrown if the GitHub url is not of valid format |
◆ Updater() [2/3]
Nickvision::Update::Updater::Updater |
( |
const Updater & | u | ) |
|
|
noexcept |
Constructs an Updater via copy.
- Parameters
-
◆ Updater() [3/3]
Nickvision::Update::Updater::Updater |
( |
Updater && | u | ) |
|
|
noexcept |
Constructs an Updater via move.
- Parameters
-
◆ downloadUpdate()
bool Nickvision::Update::Updater::downloadUpdate |
( |
VersionType | versionType, |
|
|
const std::filesystem::path & | path, |
|
|
const std::string & | assetName, |
|
|
bool | exactMatch = true, |
|
|
const cpr::ProgressCallback & | progress = {} ) |
|
noexcept |
Downloads an update for the application.
fetchCurrentVersion should be called first before running this method.
- Parameters
-
versionType | The type of version update to download |
path | The path to save the downloaded file |
assetName | The name of the asset to download |
exactMatch | If true, the asset name must match exactly, else it can be a substring |
progress | An optional cpr::ProgressCallback to track the downloading update |
- Returns
- True if successful, else false
◆ fetchCurrentVersion()
Gets the latest version of the provided type from the GitHub repo.
This method looks for tags in the format major.minor.build-dev or major.minor.build.dev for preview versions and major.minor.build for stable versions.
- Parameters
-
versionType | The type of the version to get |
- Returns
- The current version of the provided type if available, else empty Version
◆ operator=() [1/2]
Copies an Updater.
- Parameters
-
- Returns
- this
◆ operator=() [2/2]
Moves an Updater.
- Parameters
-
- Returns
- this
◆ windowsUpdate()
bool Nickvision::Update::Updater::windowsUpdate |
( |
VersionType | versionType, |
|
|
const cpr::ProgressCallback & | progress = {} ) |
|
noexcept |
Downloads and installs an application update for Windows.
fetchCurrentVersion should be called first before running this method.
This method will download the asset that contains "setup.exe" in its name and run it.
- Parameters
-
versionType | The type of version update to install |
progress | An optional cpr::ProgressCallback to track the downloading update |
- Returns
- True if successful, else false
The documentation for this class was generated from the following file: