diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-04-25 14:14:56 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-04-27 16:23:20 +0200 |
commit | 0a8755ace26f1174e9ed99e5060c4d8da0ba010d (patch) | |
tree | 7d73b3e0151b06707d8b9df5cef25be7203a420f /src/libs/installer/packagemanagercore_p.cpp | |
parent | ff6179ea53debd66e63738382b3af62087b81af7 (diff) |
now installer can disallow to install from a remote location
- at the moment the implementation is windows only
- in some cases it is problematically to install big installers from a
remote location: if the connection is lost -> crash
- the installer itself can have the flag DependsOnLocalInstallerBinary in the config.xml file
- or a component can request that installer.setDependsOnLocalInstallerBinary()
Change-Id: I0c8d70ca89dd55d2d0c52bf3418f11c95b5290a1
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'src/libs/installer/packagemanagercore_p.cpp')
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 72a29e1bc..313ad3ba5 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -196,6 +196,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q , m_createLocalRepositoryFromBinary(false) , m_defaultModel(0) , m_updaterModel(0) + , m_dependsOnLocalInstallerBinary(false) { connect(this, SIGNAL(installationStarted()), m_core, SIGNAL(installationStarted())); connect(this, SIGNAL(installationFinished()), m_core, SIGNAL(installationFinished())); @@ -1358,6 +1359,15 @@ QString PackageManagerCorePrivate::registerPath() const void PackageManagerCorePrivate::runInstaller() { + if (m_dependsOnLocalInstallerBinary && !KDUpdater::pathIsOnLocalDevice(qApp->applicationFilePath())) { + setStatus(PackageManagerCore::Failure); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstallation aborted!")); + MessageBoxHandler::critical(MessageBoxHandler::currentBestSuitParent(), + QLatin1String("installationError"), tr("Error"), tr("It is not possible to install from network location")); + emit installationFinished(); + throw; + } + bool adminRightsGained = false; try { setStatus(PackageManagerCore::Running); |