From 172a901d5b562de86f3e3f6b27467d7627ced587 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 3 Jun 2019 22:34:50 +0200 Subject: [PATCH] Fix support for relocatable installations --- src/control/XournalMain.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/control/XournalMain.cpp b/src/control/XournalMain.cpp index 93dbf165..6d30dad1 100644 --- a/src/control/XournalMain.cpp +++ b/src/control/XournalMain.cpp @@ -509,6 +509,19 @@ string XournalMain::findResourcePath(string searchFile) return relative5.getParentPath().str(); } + // ----------------------------------------------------------------------- + + // Check for .../share resources directory relative to binary to support + // relocatable installations (such as e.g., AppImages) + Path relative6 = executableDir; + relative6 /= "../share/xournalpp/"; + relative6 /= searchFile; + + if (relative6.exists()) + { + return relative6.getParentPath().str(); + } + // Not found return ""; }