diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index d662c20..679a1ca 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -27,19 +27,6 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libphysis/logger EXCLUDE_FROM_ALL) target_include_directories(physis INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/target/public) target_compile_definitions(physis INTERFACE ENABLE_GAME_INSTALL) -# We should use the CMake module everywhere once distros update their packages -if (WIN32) - # FIXME: unshield should include zlib in their upstream cmake - find_package(ZLIB REQUIRED) - find_package(unshield REQUIRED) - target_link_libraries(physis INTERFACE unshield::libunshield) -else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(UNSHIELD REQUIRED IMPORTED_TARGET libunshield) - target_link_directories(physis INTERFACE ${UNSHIELD_LIBRARY_DIRS}) - target_link_libraries(physis INTERFACE ${UNSHIELD_LIBRARIES}) -endif() - set(KDSingleApplication_QT6 ON) set(KDSingleApplication_STATIC ON) add_subdirectory(kdsingleapplication EXCLUDE_FROM_ALL) diff --git a/launcher/src/gameinstaller.cpp b/launcher/src/gameinstaller.cpp index d59a2a2..bfdf47c 100644 --- a/launcher/src/gameinstaller.cpp +++ b/launcher/src/gameinstaller.cpp @@ -3,11 +3,7 @@ #include "gameinstaller.h" -#include #include -#include -#include -#include #include "astra_log.h" #include "launchercore.h" @@ -15,9 +11,6 @@ #include "profileconfig.h" #include "utility.h" -const auto installerUrl = QStringLiteral("https://download.finalfantasyxiv.com/inst/ffxivsetup.exe"); -const QByteArray installerSha256 = QByteArray::fromHex("cf70bfaaf4f429794358ef84acbcbdc4193bee109fa1b6aea81bd4de038e500e"); - GameInstaller::GameInstaller(LauncherCore &launcher, Profile &profile, QObject *parent) : QObject(parent) , m_launcher(launcher) @@ -33,50 +26,30 @@ GameInstaller::GameInstaller(LauncherCore &launcher, Profile &profile, const QSt void GameInstaller::start() { - if (m_localInstallerPath.isEmpty()) { - const auto request = QNetworkRequest(QUrl(installerUrl)); - Utility::printRequest(QStringLiteral("GET"), request); - - auto reply = m_launcher.mgr()->get(request); - - QObject::connect(reply, &QNetworkReply::finished, [this, reply] { - if (reply->error() != QNetworkReply::NetworkError::NoError) { - Q_EMIT error(reply->errorString()); - return; - } - - const QDir dataDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation); - - const QByteArray data = reply->readAll(); - QCryptographicHash hash(QCryptographicHash::Sha256); - hash.addData(data); - - if (hash.result() != installerSha256) { - Q_EMIT error(i18n("The installer failed the integrity check!")); - return; - } - - QFile file(dataDir.absoluteFilePath(QStringLiteral("ffxivsetup.exe"))); - file.open(QIODevice::WriteOnly); - file.write(data); - file.close(); - - m_localInstallerPath = file.fileName(); - installGame(); - }); - } else { - installGame(); - } + installGame(); } void GameInstaller::installGame() { const QDir installDirectory = m_profile.config()->gamePath(); - const std::string installDirectoryStd = installDirectory.absolutePath().toStdString(); - const std::string fileNameStd = m_localInstallerPath.toStdString(); + const QDir bootDir = installDirectory.absoluteFilePath(QStringLiteral("boot")); + if (!bootDir.exists()) { + QDir().mkpath(bootDir.path()); + } - physis_install_game(fileNameStd.c_str(), installDirectoryStd.c_str()); + const QDir gameDir = installDirectory.absoluteFilePath(QStringLiteral("game")); + if (!gameDir.exists()) { + QDir().mkpath(gameDir.path()); + } + + QFile bootVerFile(bootDir.absoluteFilePath(QStringLiteral("ffxivboot.ver"))); + bootVerFile.open(QIODevice::WriteOnly); + bootVerFile.write(QByteArrayLiteral("2012.01.01.0000.0000")); + + QFile gameVerFile(gameDir.absoluteFilePath(QStringLiteral("ffxivgame.ver"))); + gameVerFile.open(QIODevice::WriteOnly); + gameVerFile.write(QByteArrayLiteral("2012.01.01.0000.0000")); m_profile.readGameVersion(); diff --git a/zone.xiv.astra.yml b/zone.xiv.astra.yml index bc0a986..60b68c5 100644 --- a/zone.xiv.astra.yml +++ b/zone.xiv.astra.yml @@ -48,18 +48,6 @@ modules: branch: master cleanup: - /lib/debug - - name: unshield - cleanup: - - /bin - - /include - - /lib/pkgconfig - buildsystem: cmake-ninja - config-opts: - - -DCMAKE_BUILD_TYPE=RelWithDebInfo - sources: - - type: git - url: https://github.com/twogood/unshield.git - branch: main - name: libsecret cleanup: - /bin