From 49751332751d24bf095b2adbcb0c0e651ed3615d Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 31 Mar 2019 22:24:53 +0200 Subject: [PATCH 1/4] Fix version showing as 'VERSION' in AppVeyor builds (fix #1609) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08c510301..f8a8d035e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ project(Grabber) if((NOT DEFINED VERSION) OR ((DEFINED NIGHTLY) AND (NIGHTLY MATCHES "1"))) set(VERSION "7.0.0") else() - string(REGEX REPLACE "^v" "" VERSION VERSION) + string(REGEX REPLACE "^v" "" VERSION "${VERSION}") endif() set(USE_SSL 1) From 878e0b80c0514f6fd7989ad1e5696d2d554579f3 Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 31 Mar 2019 23:31:19 +0200 Subject: [PATCH 2/4] Make Grabber platform-aware (issue #1608) --- CMakeLists.txt | 9 +++++++++ gui/src/about-window.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8a8d035e..8b0fe9e91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,13 @@ if((NOT DEFINED VERSION) OR ((DEFINED NIGHTLY) AND (NIGHTLY MATCHES "1"))) else() 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) # Android settings @@ -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)); From 0af23887b50557b864341c23d5893cb06d7dd98f Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 31 Mar 2019 23:41:49 +0200 Subject: [PATCH 3/4] Fix wrong installer downloaded on x86 (fix #1608) --- lib/src/updater/program-updater.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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(); From 5fd4a21d334c1586b2394ecd6fc8e843add9d748 Mon Sep 17 00:00:00 2001 From: Bionus Date: Sun, 31 Mar 2019 23:43:18 +0200 Subject: [PATCH 4/4] Version 7.0.1 --- CMakeLists.txt | 2 +- releases/setup.iss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b0fe9e91..f530ff594 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ 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}") endif() 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