There is a new version of Sandboxie-Plus available.
New version: %1
Do you want to download the latest version?
"); + else if (!UpdateUrl.isEmpty()) + FullMessage += tr("Do you want to go to the download page?
").arg(UpdateUrl); + + CCheckableMessageBox mb(this); + mb.setWindowTitle("Sandboxie-Plus"); + QIcon ico(QLatin1String(":/SandMan.png")); + mb.setIconPixmap(ico.pixmap(64, 64)); + //mb.setTextFormat(Qt::RichText); + mb.setText(FullMessage); + mb.setCheckBoxText(tr("Ignore this update, notify me anout the next one.")); + mb.setCheckBoxVisible(!bManual); + + if (!UpdateUrl.isEmpty() || !DownloadUrl.isEmpty()) { + mb.setStandardButtons(QDialogButtonBox::Yes | QDialogButtonBox::No); + mb.setDefaultButton(QDialogButtonBox::Yes); + } + else + mb.setStandardButtons(QDialogButtonBox::Ok); + + mb.exec(); + + if (mb.isChecked()) + theConf->SetValue("Options/IgnoredUpdates", IgnoredUpdates << Version); + + if (mb.clickedStandardButton() == QDialogButtonBox::Yes) + { + if (!DownloadUrl.isEmpty()) + { + QNetworkRequest Request = QNetworkRequest(DownloadUrl); + Request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); + //Request.setRawHeader("Accept-Encoding", "gzip"); + QNetworkReply* pReply = m_RequestManager->get(Request); + connect(pReply, SIGNAL(finished()), this, SLOT(OnUpdateDownload())); + connect(pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(OnUpdateProgress(qint64, qint64))); + + m_pProgressDialog->OnStatusMessage(tr("Downloading new version...")); + m_pProgressDialog->show(); + } + else + QDesktopServices::openUrl(UpdateUrl); + } + } + } + + if (bNothing) + { + theConf->SetValue("Options/NextCheckForUpdates", QDateTime::currentDateTime().addDays(7).toTime_t()); + + if (bManual) + QMessageBox::information(this, "Sandboxie-Plus", tr("No new updates found, your Sandboxie-Plus is up to date.")); + } +} + +void CSandMan::OnUpdateProgress(qint64 bytes, qint64 bytesTotal) +{ + if (bytesTotal != 0) + m_pProgressDialog->OnProgressMessage("", 100 * bytes / bytesTotal); +} + +void CSandMan::OnUpdateDownload() +{ + QString TempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation); + if (TempDir.right(1) != "/") + TempDir += "/"; + + m_pProgressDialog->OnProgressMessage("", -1); + + QNetworkReply* pReply = qobject_castNew Sandboxie-Plus has been downloaded to the following location:
Do you want to begin the installation. If any programs are running sandboxed, they will be terminated.
") + .arg(FilePath).arg("File:///" + TempDir); + if (QMessageBox("Sandboxie-Plus", Message, QMessageBox::Information, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape, QMessageBox::NoButton).exec() == QMessageBox::Yes) + QProcess::startDetached(FilePath); +} + +void CSandMan::OnHelp() +{ + if (sender() == m_pSupport) + QDesktopServices::openUrl(QUrl("https://xanasoft.com/go.php?to=donate")); + else if (sender() == m_pForum) + QDesktopServices::openUrl(QUrl("https://xanasoft.com/go.php?to=forum")); + else if (sender() == m_pManual) + QDesktopServices::openUrl(QUrl("https://xanasoft.com/go.php?to=sbie-docs")); + else + QDesktopServices::openUrl(QUrl("https://www.patreon.com/DavidXanatos")); +} + void CSandMan::OnAbout() { if (sender() == m_pAbout) @@ -1172,8 +1425,6 @@ void CSandMan::OnAbout() } else if (sender() == m_pAboutQt) QMessageBox::aboutQt(this); - else - QDesktopServices::openUrl(QUrl("https://www.patreon.com/DavidXanatos")); } void CSandMan::SetDarkTheme(bool bDark) diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index 7b029ffa24..4c6dcb1cae 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -6,6 +6,7 @@ #include "../MiscHelpers/Common/TreeViewEx.h" #include "../MiscHelpers/Common/PanelView.h" #include "../MiscHelpers/Common/ProgressDialog.h" +#include "../MiscHelpers/Common/NetworkAccessManager.h" #include "Models/ResMonModel.h" #include "Models/ApiMonModel.h" #includeSandboxie requires a driver to operate (SbieDrv.sys), Windows however denies loading a driver file that has not been digitally signed using an expensive EV-Code Signing Certificate. " - "Such certificates cost upwards of 1000$ per year!
" - "Luckily brave hackers have Leaked a few of these Certificates over the years, one of them was found by the author of this software and put to good use.
" - "Unfortunately, such certificates have been abused by malware authors resulting in many Anti Malware Fools being Lazy and flagging Everything signed with them Wrongfully as Malware. " - "This Prejudice is Damaging the Open Source Ecosystem as most nonprofit developers can't afford to waste this kind of money every year only to pay that Windows Kernel \"Tax\".
" - "Therefore, the required driver is provided in an obfuscated form and before use must be unpacked. " - "When doing so said said Anti Viruses will complain and attempt to destroy the freshly created file. " - "Please be aware that this is a false positive caused by the necessary use of a compromitted certificate. " - "If this happens you will be notified and offered the option to repeat the unpacking operation, for the operation to succeed you will need to configure an aproproate exemption.
" - - "" - "If you want the project to obtain a genuine EV-Code Signing Certificate please visit the Homepage and please donate.
" - "" - - "If you want to proceed with the unpacking of the driver pres YES.
" - ); - QMessageBox *msgBox = new QMessageBox(NULL); - msgBox->setAttribute(Qt::WA_DeleteOnClose); - msgBox->setWindowTitle("Sandboxie-Plus"); - msgBox->setText(Caption); - msgBox->setInformativeText(Text); - msgBox->setStandardButtons(QMessageBox::Yes); - msgBox->addButton(QMessageBox::No); - msgBox->setDefaultButton(QMessageBox::Yes); - - QIcon ico(QLatin1String(":/SandMan.png")); - msgBox->setIconPixmap(ico.pixmap(64, 64)); - - return msgBox->exec() == QMessageBox::Yes; -} - -void UnPackDrivers() -{ - bool notifyNotOk = false; - QDir appDir(QApplication::applicationDirPath()); - foreach(const QString& FileName, appDir.entryList(QStringList("*.sys.rc4"), QDir::Files)) - { - QString InName = QApplication::applicationDirPath() + "/" + FileName; - QString OutName = InName.mid(0, InName.length() - 4); - - QFileInfo InInfo(InName); - QFileInfo OutInfo(OutName); - if (InInfo.size() != OutInfo.size() /*|| InInfo.lastModified() > OutInfo.lastModified()*/) - { - if (theConf->GetBool("Options/NotifyUnPack", true)) { - if (!NotifyCert()) { - notifyNotOk = true; - break; - } - theConf->SetValue("Options/NotifyUnPack", false); - } - - retry: - if (!TransformFile(InName, OutName)) - QMessageBox::warning(NULL, "Sandboxie-Plus", QObject::tr("Failed to decrypt %1 ensure app directory is writable.").arg(FileName)); - else if (!TestFile(OutName)) - { - if (QMessageBox("Sandboxie-Plus", - QObject::tr("The decrypted file %1 seam to have been removed. Retry file extraction?").arg(FileName), - QMessageBox::Information, QMessageBox::Yes | QMessageBox::Default, QMessageBox::Cancel, QMessageBox::NoButton).exec() == QMessageBox::Yes) - goto retry; - notifyNotOk = true; - } - } - } - if (notifyNotOk) - QMessageBox::warning(NULL, "Sandboxie-Plus", QObject::tr("Without the Driver Sandboxie-Plus wont be able to run properly.")); -} \ No newline at end of file