1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 19:57:45 +00:00
astra/launcher/include/assetupdater.h

74 lines
2.3 KiB
C
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
2022-08-15 11:14:37 -04:00
#include <QJsonArray>
#include <QObject>
2022-08-15 11:14:37 -04:00
#include <QTemporaryDir>
#include <qcorotask.h>
#include "launchercore.h"
class LauncherCore;
class QNetworkReply;
class AssetUpdater : public QObject
{
Q_OBJECT
2023-09-17 08:32:47 -04:00
public:
explicit AssetUpdater(Profile &profile, LauncherCore &launcher, QObject *parent = nullptr);
/// Checks for any asset updates. (This currently only means Dalamud.)
/// \return False if the asset update failed, which should be considered fatal and Dalamud should not be used.
QCoro::Task<bool> update();
private:
QCoro::Task<bool> checkRemoteCompatibilityToolVersion();
2023-12-20 20:19:48 -05:00
QCoro::Task<bool> checkRemoteDxvkVersion();
QCoro::Task<bool> checkRemoteDalamudAssetVersion();
QCoro::Task<bool> checkRemoteDalamudVersion();
QCoro::Task<bool> installCompatibilityTool();
2023-12-20 20:19:48 -05:00
QCoro::Task<bool> installDxvkTool();
QCoro::Task<bool> installDalamudAssets();
QCoro::Task<bool> installDalamud();
QCoro::Task<bool> installRuntime();
[[nodiscard]] QUrl dalamudVersionManifestUrl() const;
2023-09-17 09:02:11 -04:00
[[nodiscard]] QUrl dalamudAssetManifestUrl() const;
[[nodiscard]] QUrl dotnetRuntimePackageUrl(const QString &version) const;
[[nodiscard]] QUrl dotnetDesktopPackageUrl(const QString &version) const;
bool extractZip(const QString &filePath, const QString &directory);
LauncherCore &launcher;
QString m_remoteDalamudVersion;
QString m_remoteRuntimeVersion;
QTemporaryDir m_tempDir;
QDir m_wineDir;
2023-12-20 20:19:48 -05:00
QDir m_dxvkDir;
QDir m_dataDir;
QDir m_appDataDir;
QDir m_dalamudDir;
QDir m_dalamudAssetDir;
QDir m_dalamudRuntimeDir;
int m_remoteDalamudAssetVersion = -1;
QJsonArray m_remoteDalamudAssetArray;
QString m_remoteDalamudDownloadUrl;
QString m_remoteDalamudAssetPackageUrl;
QString m_remoteCompatibilityToolVersion;
2023-12-20 20:19:48 -05:00
QString m_remoteDxvkToolVersion;
// TODO: hardcoded
QString m_remoteCompatibilityToolUrl =
QStringLiteral("https://github.com/goatcorp/wine-xiv-git/releases/download/8.5.r4.g4211bac7/wine-xiv-staging-fsync-git-ubuntu-8.5.r4.g4211bac7.tar.xz");
2023-12-20 20:19:48 -05:00
QString m_remoteDxvkToolUrl = QStringLiteral("https://github.com/doitsujin/dxvk/releases/download/v2.3/dxvk-2.3.tar.gz");
Profile &m_profile;
2022-01-27 10:46:22 -05:00
};