From 416bcde3dc281a8411fb91fc6820156a0bc86816 Mon Sep 17 00:00:00 2001 From: Collecting Date: Fri, 26 Dec 2025 02:23:17 +0000 Subject: [PATCH] feat(updater): Improved Updater System w/ Automation & SCM Logic Changes Signed-off-by: Collecting --- src/citron/updater/updater_service.h | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/citron/updater/updater_service.h b/src/citron/updater/updater_service.h index bfa18aa90..e18b7a88a 100644 --- a/src/citron/updater/updater_service.h +++ b/src/citron/updater/updater_service.h @@ -9,14 +9,12 @@ #include #include #include - #include #include namespace Updater { -// Declarations for helper functions -QString FormatDateTimeString(const std::string& iso_string); +// Declarations for helper functions to satisfy -Werror=missing-declarations std::string ExtractCommitHash(const std::string& version_string); QByteArray GetFileChecksum(const std::filesystem::path& file_path); @@ -28,8 +26,6 @@ struct DownloadOption { struct UpdateInfo { std::string version; std::vector download_options; - std::string checksum_url; - std::string expected_checksum; std::string changelog; std::string release_date; bool is_newer_version = false; @@ -44,18 +40,18 @@ public: explicit UpdaterService(QObject* parent = nullptr); ~UpdaterService() override; - void CheckForUpdates(); + void CheckForUpdates(const QString& override_channel = QString()); void DownloadAndInstallUpdate(const std::string& download_url); void CancelUpdate(); - std::string GetCurrentVersion() const; + std::string GetCurrentVersion(const QString& channel = QString()) const; bool IsUpdateInProgress() const; static bool HasStagedUpdate(const std::filesystem::path& app_directory); static bool ApplyStagedUpdate(const std::filesystem::path& app_directory); - #ifdef _WIN32 +#ifdef _WIN32 bool LaunchUpdateHelper(); - #endif +#endif signals: void UpdateCheckCompleted(bool has_update, const UpdateInfo& update_info); @@ -71,24 +67,16 @@ private slots: private: void InitializeSSL(); - void ConfigureSSLForRequest(QNetworkRequest& request); void ParseUpdateResponse(const QByteArray& response, const QString& channel); - bool CompareVersions(const std::string& current, const std::string& latest) const; - #ifdef _WIN32 +#ifdef _WIN32 bool ExtractArchive(const std::filesystem::path& archive_path, const std::filesystem::path& extract_path); - #ifndef CITRON_ENABLE_LIBARCHIVE - bool ExtractArchiveWindows(const std::filesystem::path& archive_path, const std::filesystem::path& extract_path); - #endif bool InstallUpdate(const std::filesystem::path& update_path); bool CreateBackup(); bool RestoreBackup(); bool CreateUpdateHelperScript(const std::filesystem::path& staging_path); - #endif +#endif bool CleanupFiles(); - std::filesystem::path GetTempDirectory() const; - std::filesystem::path GetApplicationDirectory() const; - std::filesystem::path GetBackupDirectory() const; bool EnsureDirectoryExists(const std::filesystem::path& path) const; std::unique_ptr network_manager;