Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This script downloads and installs/updates Manic Digger for Debian-based distros
- # Version: 1.0
- # Author: Zarko Zivanov
- # Licence: GPL v3
- # Usage:
- # - download, save as InstallManicDigger.sh
- # - run with
- # bash InstallManicDigger.sh
- # or make it executable and run it as usual
- # - enter root password if prompted (needed for installing dependencies)
- #Install dependencies
- for dep in mono-complete libxi6 libgl1-mesa-dev libopenal1 wget unzip icoutils; do
- installed=$(dpkg -l $dep | grep "ii $dep")
- if [ "$installed" == "" ]; then
- sudo apt-get install $dep
- fi
- done
- # Download latest binary
- BINZIP=/tmp/ManicDiggerBinary.zip
- wget -O $BINZIP http://sourceforge.net/projects/manicdigger/files/latest/download?source=files
- # Unpack files
- INSTALLDIR=~/Manic\ Digger
- UNPACKDIR=/tmp/ManicDiggerUnpack/
- unzip -o "$BINZIP" -d "$UNPACKDIR"
- mkdir -p "$INSTALLDIR"
- cp -rf "$UNPACKDIR"/ManicDigger20*/* "$INSTALLDIR"
- # Extract icon
- wrestool -x -t 14 -o "$UNPACKDIR" "$INSTALLDIR"/ManicDigger.exe
- icotool -x "$UNPACKDIR"/*.ico -o "$INSTALLDIR"/ManicDigger.png
- # Create launcher
- LAUNCHER=~/Desktop/Manic\ Digger.desktop
- echo -e "#!/usr/bin/env xdg-open" > "$LAUNCHER"
- echo -e "\n[Desktop Entry]" >> "$LAUNCHER"
- echo -e "\nVersion=1.0" >> "$LAUNCHER"
- echo -e "\nType=Application" >> "$LAUNCHER"
- echo -e "\nTerminal=false" >> "$LAUNCHER"
- echo -e "\nExec=mono \"$INSTALLDIR/ManicDigger.exe\"" >> "$LAUNCHER"
- echo -e "\nPath=$INSTALLDIR" >> "$LAUNCHER"
- echo -e "\nName=Manic Digger" >> "$LAUNCHER"
- echo -e "\nIcon=$INSTALLDIR/ManicDigger.png" >> "$LAUNCHER"
- chmod 755 "$LAUNCHER"
- cp "$LAUNCHER" ~/.local/share/applications/
- # Delete temporary files
- rm -rf "$UNPACKDIR"
- rm -f "$BINZIP"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement