diff options
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 9d3cd8885..9df36b5a7 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -71,14 +71,19 @@ InstallerBase::~InstallerBase() int InstallerBase::run() { - KDRunOnceChecker runCheck(QLatin1String("lockmyApp1234865.lock")); - if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::ProcessList) - || runCheck.isRunning(KDRunOnceChecker::ConditionFlag::Lockfile)) { - QInstaller::MessageBoxHandler::information(0, QLatin1String("AlreadyRunning"), - QString::fromLatin1("Waiting for %1").arg(qAppName()), - QString::fromLatin1("Another %1 instance is already running. Wait " - "until it finishes, close it, or restart your system.").arg(qAppName())); - return EXIT_FAILURE; + KDRunOnceChecker runCheck(qApp->applicationDirPath() + QLatin1String("/lockmyApp1234865.lock")); + if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::Lockfile)) { + // It is possible to install an application and thus the maintenance tool into a + // directory that requires elevated permission to create a lock file. Since this + // cannot be done without requesting credentials from the user, we silently ignore + // the fact that we could not create the lock file and check the running processes. + if (runCheck.isRunning(KDRunOnceChecker::ConditionFlag::ProcessList)) { + QInstaller::MessageBoxHandler::information(0, QLatin1String("AlreadyRunning"), + QString::fromLatin1("Waiting for %1").arg(qAppName()), + QString::fromLatin1("Another %1 instance is already running. Wait " + "until it finishes, close it, or restart your system.").arg(qAppName())); + return EXIT_FAILURE; + } } QString fileName = datFile(binaryFile()); |