From 2f6a73b561d0f1b270a5ee892db858735cfa91af Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Sun, 23 Jul 2023 17:26:31 -0400 Subject: [PATCH] Fix LB version string acquisition --- app/src/frontend/launchbox/lb-install.cpp | 42 ----------------------- app/src/frontend/launchbox/lb-install.h | 1 - 2 files changed, 43 deletions(-) diff --git a/app/src/frontend/launchbox/lb-install.cpp b/app/src/frontend/launchbox/lb-install.cpp index fc8a699..0f00370 100644 --- a/app/src/frontend/launchbox/lb-install.cpp +++ b/app/src/frontend/launchbox/lb-install.cpp @@ -304,48 +304,6 @@ void Install::softReset() QString Install::name() const { return NAME; } QList Install::preferredImageModeOrder() const { return IMAGE_MODE_ORDER; } -QString Install::versionString() const -{ - // Try LaunchBox.deps.json - QFile depsJson(mCoreDirectory.path() + '/' + u"LaunchBox.deps.json"_s); - QByteArray settingsData; - Qx::IoOpReport settingsLoadReport = Qx::readBytesFromFile(settingsData, depsJson); - - if(!settingsLoadReport.isFailure()) - { - // Parse original JSON data - QJsonObject settingsObj = QJsonDocument::fromJson(settingsData).object(); - - if(!settingsObj.isEmpty()) - { - // Get key that should have version - QList res = Qx::findAllValues(QJsonValue(settingsObj), u"Unbroken.LaunchBox.Windows"); - - if(!res.isEmpty() && res.first().isString()) - { - // Check for valid version number - Qx::VersionNumber ver = Qx::VersionNumber::fromString(res.first().toString()); - - if(!ver.isNull()) - return ver.toString(); - } - } - } - - // Try unins000.exe - Qx::FileDetails uninsDetails = Qx::FileDetails::readFileDetails(path() + '/' + u"unins000.exe"_s); - if(!uninsDetails.isNull()) - { - Qx::VersionNumber ver = uninsDetails.productVersion(); - - if(!ver.isNull()) - return ver.toString(); - } - - // Fallback to generic method - return Fe::Install::versionString(); -} - Qx::Error Install::prePlatformsImport() { if(Qx::Error superErr = Fe::Install::prePlatformsImport(); superErr.isValid()) diff --git a/app/src/frontend/launchbox/lb-install.h b/app/src/frontend/launchbox/lb-install.h index 393f0a4..e26a2f1 100644 --- a/app/src/frontend/launchbox/lb-install.h +++ b/app/src/frontend/launchbox/lb-install.h @@ -107,7 +107,6 @@ class Install : public Fe::Install // Info QString name() const override; QList preferredImageModeOrder() const override; - QString versionString() const override; // Import stage notifier hooks Qx::Error prePlatformsImport() override;