0ad-matters / 0ad-appimage

@0ad appimage
MIT License
27 stars 0 forks source link

ActorEditor is inaccessible unless the appimage is extracted #1

Closed andy5995 closed 2 years ago

andy5995 commented 2 years ago

Hyperion noted:

Right in-game scenario editor is Atlas (-atlas option). Well, appimages have exactly one payload application but that could also be a shell script passing args to pyrogenesis unless there is an option -editor in which case it would run ActorEditor or in case of -h, --help print the readme.txt in binaries/system.

https://wildfiregames.com/forum/topic/91547-how-to-make-a-0ad-appimage/?do=findComment&comment=519879

andy5995 commented 2 years ago

Something like this should work:

#!/bin/bash

# The purpose of this custom AppRun script is
# to allow symlinking the AppImage and invoking
# the corresponding binary depending on which
# symlink was used to invoke the AppImage

HERE="$(dirname "$(readlink -f "${0}")")"

if [ ! -z $APPIMAGE ] ; then
  BINARY_NAME=$(basename "$ARGV0")
  if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
    exec "$HERE/usr/bin/$BINARY_NAME" "$@"
  else
    exec "$HERE/usr/bin/ippserver" "$@"
  fi
else
  exec "$HERE/usr/bin/ippserver" "$@"
fi

https://discourse.appimage.org/t/call-alternative-binary-from-appimage/93/10?u=andy5995