Skip to content

Commit

Permalink
fixed : wrongly detected as malware by windows defender
Browse files Browse the repository at this point in the history
check for update feature uses certutil command to download release data
from github. this causes windows defender to detect this app as malware.
  • Loading branch information
ksharindam committed Mar 17, 2024
1 parent 675db57 commit 39238b8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
Expand Down
18 changes: 9 additions & 9 deletions src/dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QDialogButtonBox>
#include <QPushButton>
#include <QGridLayout>
#include <QMessageBox>
#include <QColorDialog>// for BgColorDialog
#include <QDesktopServices>
#include <QUrl>
Expand Down Expand Up @@ -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(".");
Expand Down Expand Up @@ -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();
}
Expand All @@ -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);
Expand Down Expand Up @@ -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)));
}
2 changes: 1 addition & 1 deletion windows/PhotoQuick.nsi
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions windows/version_info.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <winver.h>

#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"

Expand Down

0 comments on commit 39238b8

Please sign in to comment.