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 @@ Hotpatches for the installed version, updates to the Templates.ini and translations. - Version Updates + Incremental Updates @@ -1754,13 +1754,6 @@ Unlike the preview channel, it does not include untested, potentially breaking, - - - - - - - @@ -1780,10 +1773,10 @@ Unlike the preview channel, it does not include untested, potentially breaking, - New full versions from the selected release channel. + New full installers from the selected release channel. - New Versions + Full Upgrades @@ -1860,6 +1853,20 @@ Unlike the preview channel, it does not include untested, potentially breaking, + + + + + + + + + + + + + + diff --git a/SandboxiePlus/SandMan/OnlineUpdater.cpp b/SandboxiePlus/SandMan/OnlineUpdater.cpp index dd00c8c8cb..50df9bc3a1 100644 --- a/SandboxiePlus/SandMan/OnlineUpdater.cpp +++ b/SandboxiePlus/SandMan/OnlineUpdater.cpp @@ -446,6 +446,7 @@ bool COnlineUpdater::HandleUpdate() { QString PendingUpdate; + QString OnNewRelease = GetOnNewReleaseOption(); bool bNewRelease = false; QVariantMap Release = m_UpdateData["release"].toMap(); QString ReleaseStr = Release["version"].toString(); @@ -457,7 +458,6 @@ bool COnlineUpdater::HandleUpdate() } QString OnNewUpdate = GetOnNewUpdateOption(); - bool bNewUpdate = false; QVariantMap Update = m_UpdateData["update"].toMap(); QString UpdateStr = Update["version"].toString(); @@ -486,7 +486,16 @@ bool COnlineUpdater::HandleUpdate() // solution: apply updates silently, then prompt to install new release, else prioritize installing new releases over updating the existing one // - QString OnNewRelease = GetOnNewReleaseOption(); + bool bAllowAuto = g_CertInfo.active && !g_CertInfo.expired; // To use automatic updates a valid certificate is required + + // + // if we allow for version updates but not for automatic instalation/download of new release + // ignore the release and install it using the version updater + // + + if (bNewUpdate && bNewRelease && !bAllowAuto) + bNewRelease = false; + bool bCanRunInstaller = (m_CheckMode == eAuto && OnNewRelease == "install"); bool bIsInstallerReady = false; if (bNewRelease) @@ -502,7 +511,7 @@ bool COnlineUpdater::HandleUpdate() // clear when not up to date theConf->DelValue("Updater/InstallerVersion"); - if ((bCanRunInstaller || (m_CheckMode == eAuto && OnNewRelease == "download")) || AskDownload(Release)) + if ((bAllowAuto && (bCanRunInstaller || (m_CheckMode == eAuto && OnNewRelease == "download"))) || AskDownload(Release, bAllowAuto)) { if (DownloadInstaller(Release, m_CheckMode == eManual)) return true; @@ -524,7 +533,7 @@ bool COnlineUpdater::HandleUpdate() // clear when not up to date theConf->DelValue("Updater/UpdateVersion"); - if ((bCanApplyUpdate || (m_CheckMode == eAuto && OnNewUpdate == "download")) || AskDownload(Update)) + if ((bCanApplyUpdate || (m_CheckMode == eAuto && OnNewUpdate == "download")) || AskDownload(Update, true)) { if (DownloadUpdate(Update, m_CheckMode == eManual)) return true; @@ -555,7 +564,7 @@ bool COnlineUpdater::HandleUpdate() return bNewRelease || bNewUpdate; } -bool COnlineUpdater::AskDownload(const QVariantMap& Data) +bool COnlineUpdater::AskDownload(const QVariantMap& Data, bool bAuto) { QString VersionStr = MakeVersionStr(Data); @@ -568,12 +577,25 @@ bool COnlineUpdater::AskDownload(const QVariantMap& Data) QVariantMap Installer = Data["installer"].toMap(); QString DownloadUrl = Installer["downloadUrl"].toString(); - if (!DownloadUrl.isEmpty()) + enum EAction + { + eNone = 0, + eDownload, + eNotify, + } Action = eNone; + + if (bAuto && !DownloadUrl.isEmpty()) { + Action = eDownload; FullMessage += tr("

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(ui.cmbRelease->model()); + for (int i = 1; i < ui.cmbRelease->count(); i++) { + QStandardItem* item = model->item(i); + item->setFlags(bOk ? (item->flags() | Qt::ItemIsEnabled) : (item->flags() & ~Qt::ItemIsEnabled)); + } + + if(!bOk) + ui.lblRelease->setText(tr("Supporter certificate required for automation")); + else + ui.lblRelease->setText(QString()); } OnOptChanged();