Skip to content

Commit

Permalink
fix(AppImage): AppImages fail to run if appimaged process is running
Browse files Browse the repository at this point in the history
Closes #827
  • Loading branch information
develar committed Nov 2, 2016
1 parent 4536e91 commit 224c00e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/linux/AppRun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${APPDIR}/usr/share:${XDG_DATA_DIRS}"
export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"

DESKTOP_FILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
DESKTOP_FILE_NAME=$(basename "${DESKTOP_FILE}")
APP="${DESKTOP_FILE_NAME%.*}"
BIN="$APPDIR/usr/bin/$APP"

trap atexit EXIT

# Note that the following handles 0, 1 or more arguments (file paths)
Expand Down Expand Up @@ -124,11 +129,6 @@ check_dep xdg-icon-resource
check_dep xdg-mime
check_dep xdg-desktop-menu

DESKTOP_FILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
DESKTOP_FILE_NAME=$(basename "${DESKTOP_FILE}")
APP="${DESKTOP_FILE_NAME%.*}"
BIN="$APPDIR/usr/bin/$APP"

if [ ! -f "$DESKTOP_FILE" ] ; then
echo "Desktop file is missing. Please run ${THIS} from within an AppImage."
exit 0
Expand Down

0 comments on commit 224c00e

Please sign in to comment.