diff --git a/CMakeLists.txt b/CMakeLists.txt index 08c510301..f530ff594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,9 +26,16 @@ endif() project(Grabber) if((NOT DEFINED VERSION) OR ((DEFINED NIGHTLY) AND (NIGHTLY MATCHES "1"))) - set(VERSION "7.0.0") + set(VERSION "7.0.1") else() - string(REGEX REPLACE "^v" "" VERSION VERSION) + string(REGEX REPLACE "^v" "" VERSION "${VERSION}") +endif() +if(NOT DEFINED VERSION_PLATFORM) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][mM][dD]64") + set(VERSION_PLATFORM "x64") + else() + set(VERSION_PLATFORM "x86") + endif() endif() set(USE_SSL 1) @@ -39,8 +46,10 @@ set(ANDROID_APP_VERSION_CODE 1) set(ANDROID_APP_PACKAGE_NAME "com.bionus.grabber") message(STATUS "Configuring for version '${VERSION}'") +message(STATUS "Configuring for platform '${VERSION_PLATFORM}' (${CMAKE_SYSTEM_PROCESSOR})") add_definitions(-DVERSION="${VERSION}") +add_definitions(-DVERSION_PLATFORM="${VERSION_PLATFORM}") add_definitions(-DPROJECT_WEBSITE_URL="https://bionus.github.io/imgbrd-grabber") add_definitions(-DPROJECT_GITHUB_URL="https://github.com/Bionus/imgbrd-grabber") add_definitions(-DSOURCE_ISSUES_URL="https://raw.githubusercontent.com/wiki/Bionus/imgbrd-grabber/SourceIssues.md") diff --git a/gui/src/about-window.cpp b/gui/src/about-window.cpp index 77b20850f..56dc04582 100644 --- a/gui/src/about-window.cpp +++ b/gui/src/about-window.cpp @@ -18,6 +18,7 @@ AboutWindow::AboutWindow(const QString &version, QWidget *parent) labelVersion += " - nightly"; } #endif + labelVersion += QString(" (%1)").arg(VERSION_PLATFORM); ui->labelCurrent->setText(labelVersion); ui->labelCreator->setText(ui->labelCreator->text().replace("{website}", PROJECT_WEBSITE_URL)); diff --git a/lib/src/updater/program-updater.cpp b/lib/src/updater/program-updater.cpp index bbe80821e..c867cae87 100644 --- a/lib/src/updater/program-updater.cpp +++ b/lib/src/updater/program-updater.cpp @@ -68,7 +68,19 @@ void ProgramUpdater::downloadUpdate() { QJsonDocument json = QJsonDocument::fromJson(m_source); QJsonObject lastRelease = json.object(); - QJsonObject lastAsset = lastRelease["assets"].toArray().first().toObject(); + QJsonArray lastAssets = lastRelease["assets"].toArray(); + QJsonObject lastAsset; + for (int i = 0; i < lastAssets.size(); ++i) { + const QJsonObject obj = lastAssets[i].toObject(); + const QString name = obj["name"].toString(); + if (name.endsWith(".exe") && name.contains(VERSION_PLATFORM)) { + lastAsset = obj; + } + } + if (lastAsset.isEmpty()) { + log("No proper release asset found for updatind", Logger::Error); + return; + } QUrl url(lastAsset["browser_download_url"].toString()); m_updateFilename = url.fileName(); diff --git a/releases/setup.iss b/releases/setup.iss index 7f2c68734..56ad22734 100755 --- a/releases/setup.iss +++ b/releases/setup.iss @@ -19,7 +19,7 @@ #endif #ifndef MyAppVersion -# define MyAppVersion "7.0.0" +# define MyAppVersion "7.0.1" #endif #ifndef QtApngDll