updating: add support for prereleases (#8296)

This commit is contained in:
Andrey Nekrasov
2020-12-10 19:05:43 +03:00
committed by GitHub
parent 8a7824924a
commit 84932eb9da
9 changed files with 114 additions and 64 deletions

View File

@@ -5,26 +5,27 @@
#include <future>
#include <filesystem>
#include <winrt/Windows.Foundation.h>
#include <expected.hpp>
#include "notifications.h"
#include "../VersionHelper.h"
namespace updating
{
using winrt::Windows::Foundation::Uri;
struct new_version_download_info
{
winrt::Windows::Foundation::Uri release_page_uri = nullptr;
std::wstring version_string;
winrt::Windows::Foundation::Uri installer_download_url = nullptr;
Uri release_page_uri = nullptr;
VersionHelper version{ 0, 0, 0 };
Uri installer_download_url = nullptr;
std::wstring installer_filename;
};
std::future<void> try_autoupdate(const bool download_updates_automatically, const notifications::strings&);
std::filesystem::path get_pending_updates_path();
std::future<std::wstring> check_new_version_available(const notifications::strings&);
std::future<std::wstring> download_update(const notifications::strings&);
std::future<nonstd::expected<new_version_download_info, std::wstring>> get_new_github_version_info_async(const notifications::strings& strings, const bool prerelease = false);
// non-localized
constexpr inline std::wstring_view INSTALLER_FILENAME_PATTERN = L"powertoyssetup";
}
}