mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-07 22:58:06 +00:00
Checks latest release and opens a dialog containing the changelog, and allow the user to select a specific build to download. After downloading, it prompts the user to open it. On Windows, this just opens up the zip in File Explorer. In the future setup files will be available. On macOS this opens up the DMG in Finder so the user can drag it to the Applications folder. Android retains the auto-update functionality from before, but updated to the new scheme. Body/View on Forgejo are not implemented, that should be in a future PR. Additionally, moved some common httplib incantations to `Common::Net`. This will serve as the common network accessor and JSON parser from here on out. TODO: - [x] android :( - [x] Search for builds based on keywords, with weights towards certain builds (e.g. macOS will search for dmg then tar.gz, windows msvc then mingw/exe then zip, etc.) - [x] remove linux leftovers - [x] don't allow asset selection on platforms w/o assets - [x] nightly changelog should be in the real FUTURE IMPLEMENTATION: - [ ] Body/View on Forgejo for Android - [ ] Setup files for Windows (Eden/nightly are separate) -- maybe portable/setup selector? - [ ] Something else I'm forgetting Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3845
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// Copyright Citra Emulator Project / Azahar Emulator Project
|
|
// Licensed under GPLv2 or any later version
|
|
// Refer to the license.txt file included.
|
|
|
|
#ifdef NIGHTLY_BUILD
|
|
#include <boost/algorithm/string/classification.hpp>
|
|
#include <boost/algorithm/string/split.hpp>
|
|
#endif
|
|
|
|
#include <fmt/format.h>
|
|
#include "common/net/net.h"
|
|
#include "common/scm_rev.h"
|
|
#include "update_checker.h"
|
|
|
|
#include "common/logging.h"
|
|
|
|
std::optional<Common::Net::Release> UpdateChecker::GetUpdate() {
|
|
const auto latest = Common::Net::GetLatestRelease();
|
|
if (!latest) return std::nullopt;
|
|
|
|
LOG_INFO(Frontend, "Received update {}", latest->title);
|
|
|
|
#ifdef NIGHTLY_BUILD
|
|
std::vector<std::string> result;
|
|
|
|
boost::split(result, latest->tag, boost::is_any_of("."));
|
|
if (result.size() != 2)
|
|
return std::nullopt;
|
|
|
|
const std::string tag = result[1];
|
|
|
|
boost::split(result, std::string{Common::g_build_version}, boost::is_any_of("-"));
|
|
if (result.empty())
|
|
return std::nullopt;
|
|
|
|
const std::string build = result[0];
|
|
#else
|
|
const std::string tag = latest->tag;
|
|
const std::string build = Common::g_build_version;
|
|
#endif
|
|
|
|
if (tag != build)
|
|
return latest;
|
|
|
|
return std::nullopt;
|
|
}
|