From 0ab9c475447699f14781269d4c0702a7ed06a4c5 Mon Sep 17 00:00:00 2001
From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com>
Date: Sun, 3 Dec 2023 20:05:40 +0100
Subject: [PATCH] 1.12.4
---
CHANGELOG.md | 4 ++
SandboxiePlus/SandMan/Forms/SettingsWindow.ui | 27 ++++++----
SandboxiePlus/SandMan/OnlineUpdater.cpp | 51 ++++++++++++++-----
SandboxiePlus/SandMan/OnlineUpdater.h | 2 +-
.../SandMan/Windows/SettingsWindow.cpp | 29 ++++++++---
5 files changed, 82 insertions(+), 31 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ab5823647..ac349f6ed0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- fixed running sandboxed processes located in a imdisk volume [#3472](https://github.com/sandboxie-plus/Sandboxie/discussions/3472)
+### Changed
+- without an active, non expired, supporter certificate, automatic updates/downloads are not longer available for the stable channel
+ - the autoamtic updater will still work and notify about new stable releases, the user will be guided to visit the download page and download the latest installer manually
+
## [1.12.3 / 5.67.3] - 2023-12-02
diff --git a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui
index 8effb8dc8d..9f4274454b 100644
--- a/SandboxiePlus/SandMan/Forms/SettingsWindow.ui
+++ b/SandboxiePlus/SandMan/Forms/SettingsWindow.ui
@@ -1722,7 +1722,7 @@
Do you want to download the installer?
"); - else if(Data.contains("files")) + } + else if (bAuto && Data.contains("files")) { + Action = eDownload; FullMessage += tr("Do you want to download the updates?
"); - else if (!UpdateUrl.isEmpty()) - FullMessage += tr("Do you want to go to the update page?
").arg(UpdateUrl); + } + else if (!UpdateUrl.isEmpty()) { + Action = eNotify; + FullMessage += tr("Do you want to go to the download page?
").arg(UpdateUrl); + } CCheckableMessageBox mb(theGUI); mb.setWindowTitle("Sandboxie-Plus"); @@ -584,18 +606,18 @@ bool COnlineUpdater::AskDownload(const QVariantMap& Data) mb.setCheckBoxText(tr("Don't show this update anymore.")); mb.setCheckBoxVisible(m_CheckMode != eManual); - if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty() || Data.contains("files")) { + if (Action != eNone) { mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel); mb.setDefaultButton(QDialogButtonBox::Yes); - } - else + } else mb.setStandardButtons(QDialogButtonBox::Ok); mb.exec(); if (mb.clickedStandardButton() == QDialogButtonBox::Yes) { - if (!DownloadUrl.isEmpty() || Data.contains("files")) { + if (Action == eDownload) + { m_CheckMode = eManual; return true; } @@ -604,7 +626,8 @@ bool COnlineUpdater::AskDownload(const QVariantMap& Data) } else { - if (mb.clickedStandardButton() == QDialogButtonBox::Cancel) { + if (mb.clickedStandardButton() == QDialogButtonBox::Cancel) + { theConf->SetValue("Updater/PendingUpdate", ""); theGUI->UpdateLabel(); } diff --git a/SandboxiePlus/SandMan/OnlineUpdater.h b/SandboxiePlus/SandMan/OnlineUpdater.h index 770717e617..d3e5c8e63d 100644 --- a/SandboxiePlus/SandMan/OnlineUpdater.h +++ b/SandboxiePlus/SandMan/OnlineUpdater.h @@ -151,7 +151,7 @@ private slots: EUpdateScope ScanUpdateFiles(const QVariantMap& Update); EUpdateScope GetFileScope(const QString& Path); - bool AskDownload(const QVariantMap& Update); + bool AskDownload(const QVariantMap& Update, bool bAuto); static bool RunInstaller2(const QString& FilePath, bool bSilent); diff --git a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp index 9b5b4d6852..aa7119e27e 100644 --- a/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/SettingsWindow.cpp @@ -1381,25 +1381,42 @@ QString CSettingsWindow::GetCertLevel() void CSettingsWindow::UpdateUpdater() { + bool bOk = (g_CertInfo.active && !g_CertInfo.expired); //ui.radLive->setEnabled(false); - if (!ui.chkAutoUpdate->isChecked()) { + if (!ui.chkAutoUpdate->isChecked()) + { ui.cmbInterval->setEnabled(false); ui.cmbUpdate->setEnabled(false); ui.cmbRelease->setEnabled(false); ui.lblRevision->setText(QString()); + ui.lblRelease->setText(QString()); } - else { + else + { ui.cmbInterval->setEnabled(true); - if (ui.radStable->isChecked() && (!g_CertInfo.active || g_CertInfo.expired)) { + + if (ui.radStable->isChecked() && !bOk) { ui.cmbUpdate->setEnabled(false); ui.cmbUpdate->setCurrentIndex(ui.cmbUpdate->findData("ignore")); - ui.lblRevision->setText(tr("Supporter certificate required")); - } - else { + + ui.lblRevision->setText(tr("Supporter certificate required for access")); + } else { ui.cmbUpdate->setEnabled(true); + ui.lblRevision->setText(QString()); } + ui.cmbRelease->setEnabled(true); + QStandardItemModel* model = qobject_cast