From 0a8755ace26f1174e9ed99e5060c4d8da0ba010d Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 25 Apr 2012 14:14:56 +0200 Subject: 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 Reviewed-by: Karsten Heimrich --- src/libs/installer/packagemanagercore_p.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libs/installer/packagemanagercore_p.cpp') 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); -- cgit v1.2.3