If you notice a bug or can improve on the installer script for any particular version of Linux, feel free to add to the script.
The intention is to have a good Installer which is idiotproof - one click, maybe some yes/no questions, done. It needs to create a menu entry in the 'games' section if it exists, it needs to create a desktop icon using the Legends.ico, Maybe it should create an Update icon as well.
If you are root, it should install to root dirs, if you are a user it should install to your home.
#!/bin/sh echo echo "Legends installer 0.4.1c - starting installation... please wait" defaultDir="/usr/games/legends" startMenu="/usr/share/applications" if [ `id -u` -ne 0 ]; then echo "It is suggested that you run this install script as root to allow all" echo "users to play legends on this machine" echo echo "Procced anyway (y or n):" read proceed if [ "$proceed" != "y" ]; then echo "existing installation." exit 0 fi defaultDir="$HOME/legends" startMenu="$HOME/.local/share/applications" echo "Proceeding with user specific installation." fi echo echo "Please enter the installation location [$defaultDir]:" read installDir if [ "$installDir" = "" ]; then installDir="$defaultDir" fi echo "Preparing install directory..." mkdir -p $installDir if [ -w $installDir ]; then if [ -d $installDir ]; then echo "Install directory ready" else echo "Install location $installDir not usable (location not a directory)" exit 1 fi else echo "Install location $installDir not usable.(Cannot write to directory)" exit 1 fi #can write to dir. untar the archive. SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0` # Take the bzipped tar portion of this file and pipe it to tar. tail -n +$SKIP $0 | tar -C $installDir -xjf - # Attempt to make desktop file. echo "Attempting to create menu entries for legends..." mkdir -p $startMenu touch $startMenu/legends.desktop if [ -e $startMenu/legends.desktop ]; then cat << EOF > $startMenu/legends.desktop [Desktop Entry] Encoding=UTF-8 Name=Legends Comment=Legends fast paced Freedom of Movement FPS Exec=$installDir/runlegends Icon=$installDir/legends.ico Terminal=false Type=Application Categories=Application;Game Path=$installDir EOF echo "Menu entry created. You may start legends from the start menu." else echo "Cannot create launch menu startup." fi echo "To start legends form a command line:" echo " cd $installDir" echo " ./runlegends" echo echo "To update legends, change directory into $installDir then run" echo "the command './update' to check for available updates." echo "Legends installation completed." exit 0 __ARCHIVE_FOLLOWS__
Don't like idea to use ico, there is available good picture for Legends in png format at http://gentoo-distfiles.mirrors.tds.net/distfiles/legends.png (and at any other gentoo mirror)
Ubuntu 5.06: works fine, game icon even appears in the menu. - TerroX
If you would like a specific feature added, please note it here.
Optional Start Menu Creation: Currently coded to always install menu items. Some users may not want this.
Optional use of artsdsp: I have such string in my runlegends script:
artsdsp ./LinLegends $*