From 4711dfdd938b92b63a7d99065a828f66ecc7131d Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Fri, 12 Aug 2022 05:30:18 +0300 Subject: [PATCH] Use $APPIMAGE to determine exe folder and enable portable mode for AppImage --- src/paths.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/paths.py b/src/paths.py index 8cde08af..e0d43334 100644 --- a/src/paths.py +++ b/src/paths.py @@ -21,14 +21,15 @@ def lookupExeFolder(): if frozen: exeFolder = ( # targetdir/Bitmessage.app/Contents/MacOS/Bitmessage - os.path.dirname(sys.executable).split(os.path.sep)[0] + os.path.sep - if frozen == "macosx_app" else - os.path.dirname(sys.executable) + os.path.sep) + os.path.dirname(sys.executable).split(os.path.sep)[0] + if frozen == "macosx_app" else os.path.dirname(sys.executable)) + elif os.getenv('APPIMAGE'): + exeFolder = os.path.dirname(os.getenv('APPIMAGE')) elif __file__: - exeFolder = os.path.dirname(__file__) + os.path.sep + exeFolder = os.path.dirname(__file__) else: - exeFolder = '' - return exeFolder + return '' + return exeFolder + os.path.sep def lookupAppdataFolder():