diff options
Diffstat (limited to 'src/libs/installer/elevatedexecuteoperation.cpp')
-rw-r--r-- | src/libs/installer/elevatedexecuteoperation.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/libs/installer/elevatedexecuteoperation.cpp b/src/libs/installer/elevatedexecuteoperation.cpp index 092b0f0eb..6f2393799 100644 --- a/src/libs/installer/elevatedexecuteoperation.cpp +++ b/src/libs/installer/elevatedexecuteoperation.cpp @@ -221,30 +221,29 @@ int ElevatedExecuteOperation::Private::run(QStringList &arguments, const Operati q->setValue(QLatin1String("ExitCode"), process->exitCode()); - if (process->exitStatus() == QProcessWrapper::CrashExit) { - q->setError(UserDefinedError); - q->setErrorString(tr("Program crashed: \"%1\"").arg(callstr)); - returnValue = Error; - } + if (success) { + const QByteArray standardErrorOutput = process->readAllStandardError(); + // in error case it would be useful to see something in verbose output + if (!standardErrorOutput.isEmpty()) + qCWarning(QInstaller::lcInstallerInstallLog).noquote() << standardErrorOutput; - if (!allowedExitCodes.contains(process->exitCode()) && returnValue != NeedsRerun) { - if (!needsRerunWithReplacedVariables(arguments, type)) { + if (process->exitStatus() == QProcessWrapper::CrashExit) { q->setError(UserDefinedError); - if (customErrorMessage.isEmpty()) { - q->setErrorString(tr("Execution failed (Unexpected exit code: %1): \"%2\"") - .arg(QString::number(process->exitCode()), callstr)); + q->setErrorString(tr("Program crashed: \"%1\"").arg(callstr)); + returnValue = Error; + } else if (!allowedExitCodes.contains(process->exitCode()) && returnValue != NeedsRerun) { + if (!needsRerunWithReplacedVariables(arguments, type)) { + q->setError(UserDefinedError); + if (customErrorMessage.isEmpty()) { + q->setErrorString(tr("Execution failed (Unexpected exit code: %1): \"%2\"") + .arg(QString::number(process->exitCode()), callstr)); + } else { + q->setErrorString(customErrorMessage); + } + returnValue = Error; } else { - q->setErrorString(customErrorMessage); + returnValue = NeedsRerun; } - - QByteArray standardErrorOutput = process->readAllStandardError(); - // in error case it would be useful to see something in verbose output - if (!standardErrorOutput.isEmpty()) - qCWarning(QInstaller::lcInstallerInstallLog).noquote() << standardErrorOutput; - - returnValue = Error; - } else { - returnValue = NeedsRerun; } } Q_ASSERT(process); |