Commit 487810f7 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Workaround AppImage cannot open external app

CCBUG: 458021
parent e7f9686b
Pipeline #274387 passed with stage
in 21 minutes and 4 seconds
......@@ -280,6 +280,17 @@ QString Core::openExternalApp(QString appPath, QStringList args)
process.setProgram(appPath);
#endif
process.setArguments(args);
if (pCore->packageType() == QStringLiteral("appimage")) {
// Strip appimage custom LD_LIBRARY_PATH...
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
qDebug() << "::: GOT ENV: " << env.value("LD_LIBRARY_PATH");
QStringList libPath = env.value(QStringLiteral("LD_LIBRARY_PATH")).split(QLatin1Char(':'));
if (libPath.contains(QStringLiteral("/tmp/.mount_"))) {
libPath.takeFirst();
env.insert(QStringLiteral("LD_LIBRARY_PATH"), libPath.join(QLatin1Char(':')));
process.setProcessEnvironment(env);
}
}
qDebug() << "Starting external app" << appPath << "with arguments" << args;
if (!process.startDetached()) {
return process.errorString();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment