Skip to content

Commit

Permalink
fix appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
EchterAgo committed Apr 17, 2024
1 parent 64ede83 commit e89d4d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion electron-cash
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ if jnius:
script_dir = os.path.dirname(os.path.realpath(__file__))
is_pyinstaller = getattr(sys, 'frozen', False)
is_android = 'ANDROID_DATA' in os.environ
is_binary_distributable = is_pyinstaller or is_android
is_appimage = 'APPIMAGE' in os.environ
is_binary_distributable = is_pyinstaller or is_android or is_appimage
is_local = not is_binary_distributable and os.path.exists(os.path.join(script_dir, "electron-cash.desktop"))

if is_local:
Expand Down Expand Up @@ -460,6 +461,9 @@ def process_config_options(args):
if is_pyinstaller:
# PyInstaller sets sys.executable to the bundle file
portable_dir = os.path.dirname(os.path.realpath(sys.executable))
elif is_appimage:
# AppImage sets the APPIMAGE environment variable to the bundle file
portable_dir = os.path.dirname(os.path.realpath(os.environ["APPIMAGE"]))
else:
# We fall back to getcwd in case nothing else can be used
portable_dir = os.getcwd()
Expand Down

0 comments on commit e89d4d3

Please sign in to comment.