Advertisement
Guest User

Untitled

a guest
Jan 16th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.83 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Lines to customize BEGIN
  4. COMPANY_NAME="Daedalic Entertainment GmbH"
  5. GAME_NAME="Deponia 4"
  6. #export SDL_DYNAMIC=/my/actual/libSDL-2.0.so.0
  7.  
  8. # Lines to customize END
  9.  
  10. if [ "$XDG_DATA_HOME" = "" ]; then
  11.   export XDG_DATA_HOME="$HOME/.local/share"
  12. fi
  13.  
  14. #Create savegame folder
  15. mkdir -p "$XDG_DATA_HOME/$COMPANY_NAME/$GAME_NAME/Savegames"
  16. find "$XDG_DATA_HOME/$COMPANY_NAME/$GAME_NAME/" -exec chmod +w {} \;
  17.  
  18. LOGPATH="$XDG_DATA_HOME/$COMPANY_NAME/$GAME_NAME/messages.log"
  19.  
  20. # Change to game directory
  21. CANONPATH=`readlink -f "$0"`
  22. cd "`dirname "$CANONPATH"`"
  23.  
  24. if [ ! -e libs64 ] || [ ! -e config.ini ]
  25. then
  26.     echo "Missing libs64/ and config.ini in `pwd`"
  27.     echo "Your installation is incomplete!"
  28.     exit 1
  29. fi
  30.  
  31. # Uncomment the line below to dump core when the game crashes; useful for
  32. # debugging, but only works if the game directory is user-writable!
  33. #ulimit -c unlimited
  34.  
  35. MACHINE=`uname -m`
  36. if [ "$MACHINE" = x86_64 ]
  37. then
  38.     LIBS=./libs64
  39.     BIN=./Deponia4
  40. else
  41.     echo "unsupported architecture $MACHINE"
  42.     exit 1
  43. fi
  44.  
  45. # Run the game:
  46. export LD_LIBRARY_PATH=$LIBS:"$LD_LIBRARY_PATH"
  47. if [ -z "$SDL_DYNAMIC" ]
  48. then
  49.     export SDL_DYNAMIC_API=$SDL_DYNAMIC
  50. fi
  51. $BIN $@
  52.  
  53. # Check for errors
  54. e=$?
  55. if [ $e -ne 0 ]
  56. then
  57.     echo ""
  58.     echo "It looks like the player crashed! If you need support, please include the"
  59.     echo "contents of the log file in your problem report."
  60.  
  61.     if [ -f "$LOGPATH" ]
  62.     then
  63.         echo "The log file is stored at: $LOGPATH"
  64.  
  65.         echo "" >> $LOGPATH
  66.         echo "Libraries used:" >> $LOGPATH
  67.         ldd $BIN >> $LOGPATH 2>&1
  68.  
  69.         echo "" >> $LOGPATH
  70.         GLXINFO=`which glxinfo`
  71.         if [ -z "$GLXINFO" ]
  72.         then
  73.             echo "glxinfo not found!" >> $LOGPATH
  74.         else
  75.             echo "Output of glxinfo:" >>$LOGPATH
  76.             glxinfo >>$LOGPATH 2>&1
  77.         fi
  78.        
  79.     else
  80.         echo "Unfortunately, no log file has been created!"
  81.     fi
  82. fi
  83.  
  84. exit $e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement