From 39238b886395a24dcd4f60d8dad5d79b63a165eb Mon Sep 17 00:00:00 2001 From: Arindam Chaudhuri Date: Sun, 17 Mar 2024 20:13:40 +0530 Subject: [PATCH] fixed : wrongly detected as malware by windows defender check for update feature uses certutil command to download release data from github. this causes windows defender to detect this app as malware. --- src/common.h | 2 +- src/dialogs.cpp | 18 +++++++++--------- windows/PhotoQuick.nsi | 2 +- windows/version_info.rc | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/common.h b/src/common.h index 999eaba..337d7b4 100644 --- a/src/common.h +++ b/src/common.h @@ -5,7 +5,7 @@ #include "exif.h" #define PROG_NAME "PhotoQuick" -#define PROG_VERSION "4.19.1" +#define PROG_VERSION "4.19.2" #define COPYRIGHT_YEAR "2017-2024" #define AUTHOR_NAME "Arindam Chaudhuri" #define AUTHOR_EMAIL "ksharindam@gmail.com" diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 566adc5..f066359 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include // for BgColorDialog #include #include @@ -614,7 +615,7 @@ BgColorDialog:: selectColorName(QString color_name) // ----------------- Update Manager Dialog ------------------- // // check if versionA is later than versionB (versions must be in x.x.x format) -static bool isLaterThan(QString versionA, QString versionB) +bool isLaterThan(QString versionA, QString versionB) { QStringList listA = versionA.split("."); QStringList listB = versionB.split("."); @@ -657,6 +658,12 @@ UpdateDialog:: UpdateDialog(QWidget *parent) : QDialog(parent) void UpdateDialog:: checkForUpdate() { +#ifdef Q_OS_WIN + if (QMessageBox::question(this, "Open Browser?", "Open browser to view latest release?", + QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes){ + QDesktopServices::openUrl(QUrl("https://github.com/ksharindam/photoquick/releases/latest")); + } +#else if (not latest_version.isEmpty()) { return download(); } @@ -673,11 +680,7 @@ UpdateDialog:: checkForUpdate() QString url("https://api.github.com/repos/ksharindam/photoquick/releases/latest"); QString info_file = desktopPath() + "/photoquick.json"; -#ifdef _WIN32 - if (QProcess::execute("certutil", {"-urlcache", "-split", "-f", url, info_file})!=0){ -#else if (QProcess::execute("wget", {"--inet4-only", "-O", info_file, url})!=0){// ipv4 connects faster -#endif QFile::remove(info_file);// 0 byte photoquick.json file remains if wget fails textView->setPlainText("Failed to connect !\nCheck your internet connection."); updateBtn->setEnabled(true); @@ -722,17 +725,14 @@ UpdateDialog:: checkForUpdate() textView->setPlainText("Error ! Unable to parse release version."); } updateBtn->setEnabled(true); +#endif } void UpdateDialog:: download() { -#ifdef _WIN32 - QString filename = QString("PhotoQuick-%1.exe").arg(latest_version);// eg. PhotoQuick-4.4.2.exe -#else // currently we provide PhotoQuick-x86_64.AppImage and PhotoQuick-armhf.AppImage QString filename = QString("PhotoQuick-%1.AppImage").arg(ARCH); -#endif QString addr("https://github.com/ksharindam/photoquick/releases/latest/download/%1"); QDesktopServices::openUrl(QUrl(addr.arg(filename))); } diff --git a/windows/PhotoQuick.nsi b/windows/PhotoQuick.nsi index 5ef6e8e..b9900f4 100755 --- a/windows/PhotoQuick.nsi +++ b/windows/PhotoQuick.nsi @@ -1,6 +1,6 @@ ; HM NIS Edit Wizard helper defines !define PROG_NAME "PhotoQuick" -!define PROG_VERSION "4.19.1" +!define PROG_VERSION "4.19.2" !define PROG_PUBLISHER "Arindamsoft" !define PROG_ICON "photoquick.ico" !define PROG_EXEC "photoquick.exe" diff --git a/windows/version_info.rc b/windows/version_info.rc index e562867..29da78c 100644 --- a/windows/version_info.rc +++ b/windows/version_info.rc @@ -1,7 +1,7 @@ #include -#define PROG_VERSION "4.19.1" -#define FILE_VERSION 4,19,1,0 +#define PROG_VERSION "4.19.2" +#define FILE_VERSION 4,19,2,0 IDI_ICON1 ICON "../data/photoquick.ico"