diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-05-25 14:44:01 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-05-30 08:50:29 +0200 |
commit | b7a40c7d68ceac52f7a4d1508f7eee54168b9e1f (patch) | |
tree | 449acde406549b3925d53516fb7b0e2edd526d51 | |
parent | 4af34941c41b9f088be165236ac1c4cb7f39a349 (diff) |
execute the dependsOnLocalInstallerBinary check after beginInstallation
- beginInstallation needs to be run before checking for
dependsOnLocalInstallerBinary as that value isn't set before
- with this change we can use the beginnInstallation method in the
component scripts to set this depends check
Change-Id: Ib0964ab84a43499b3dc574aa5d7aecb2c69f01f1
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 80a2463d4..e7a267469 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1342,15 +1342,6 @@ 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); @@ -1404,6 +1395,18 @@ void PackageManagerCorePrivate::runInstaller() const QList<Component*> componentsToInstall = m_core->orderedComponentsToInstall(); qDebug() << "Install size:" << componentsToInstall.size() << "components"; + callBeginInstallation(componentsToInstall); + stopProcessesForUpdates(componentsToInstall); + + 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; + } + if (!adminRightsGained) { foreach (Component *component, m_core->orderedComponentsToInstall()) { if (component->value(scRequiresAdminRights, scFalse) == scFalse) @@ -1433,9 +1436,6 @@ void PackageManagerCorePrivate::runInstaller() info.setApplicationVersion(m_core->value(QLatin1String("ProductVersion"), m_settings.applicationVersion())); - callBeginInstallation(componentsToInstall); - stopProcessesForUpdates(componentsToInstall); - const int progressOperationCount = countProgressOperations(componentsToInstall) + (m_createLocalRepositoryFromBinary ? 1 : 0); // add one more operation as we support progress double progressOperationSize = componentsInstallPartProgressSize / progressOperationCount; @@ -1537,6 +1537,18 @@ void PackageManagerCorePrivate::runPackageUpdater() const QList<Component *> componentsToInstall = m_core->orderedComponentsToInstall(); qDebug() << "Install size:" << componentsToInstall.size() << "components"; + callBeginInstallation(componentsToInstall); + stopProcessesForUpdates(componentsToInstall); + + 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 updateAdminRights = false; if (!adminRightsGained) { foreach (Component *component, componentsToInstall) { @@ -1634,9 +1646,6 @@ void PackageManagerCorePrivate::runPackageUpdater() } m_performedOperationsOld = nonRevertedOperations; // these are all operations left: those not reverted - callBeginInstallation(componentsToInstall); - stopProcessesForUpdates(componentsToInstall); - const double progressOperationCount = countProgressOperations(componentsToInstall); const double progressOperationSize = componentsInstallPartProgressSize / progressOperationCount; |