summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libs/installer/productkeycheck.cpp5
-rw-r--r--src/libs/installer/productkeycheck.h1
-rw-r--r--src/sdk/installerbase.cpp3
3 files changed, 9 insertions, 0 deletions
diff --git a/src/libs/installer/productkeycheck.cpp b/src/libs/installer/productkeycheck.cpp
index 4a8ce4677..c1dfe83d6 100644
--- a/src/libs/installer/productkeycheck.cpp
+++ b/src/libs/installer/productkeycheck.cpp
@@ -101,3 +101,8 @@ QList<int> ProductKeyCheck::registeredPages() const
{
return QList<int>();
}
+
+bool ProductKeyCheck::hasValidLicense() const
+{
+ return true;
+}
diff --git a/src/libs/installer/productkeycheck.h b/src/libs/installer/productkeycheck.h
index 221fdc7ef..b7e8c6d52 100644
--- a/src/libs/installer/productkeycheck.h
+++ b/src/libs/installer/productkeycheck.h
@@ -66,6 +66,7 @@ public:
bool isValidPackage(const QString &packageName) const;
QList<int> registeredPages() const;
+ bool hasValidLicense() const;
private:
ProductKeyCheck();
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp
index e09e651a2..043d7beca 100644
--- a/src/sdk/installerbase.cpp
+++ b/src/sdk/installerbase.cpp
@@ -287,6 +287,9 @@ int InstallerBase::run()
if (parser.isSet(QLatin1String(CommandLineOptions::SilentUpdate))) {
if (m_core->isInstaller())
throw QInstaller::Error(QLatin1String("Cannot start installer binary as updater."));
+ const ProductKeyCheck *const productKeyCheck = ProductKeyCheck::instance();
+ if (!productKeyCheck->hasValidLicense())
+ throw QInstaller::Error(QLatin1String("Silent update not allowed."));
m_core->setUpdater();
m_core->updateComponentsSilently();
}