Skip to content

Instantly share code, notes, and snippets.

@toolboc
Last active March 27, 2017 20:23
Show Gist options
  • Save toolboc/4213e8ef4183dd5e80f696cbd9bf9f61 to your computer and use it in GitHub Desktop.
Save toolboc/4213e8ef4183dd5e80f696cbd9bf9f61 to your computer and use it in GitHub Desktop.
Quake on Bash on Ubuntu on Windows
#!/bin/bash
#Quake on Bash on Ubuntu on Windows
[[ `id -u` -eq 0 ]] || { echo "Must be root to run script, try running again with sudo"; exit 1; }
#ensure Xming is installed
if [ -f "/mnt/c/Program Files (x86)/Xming/Xming.exe" ]
then
echo "XMing is installed on Windows Filesystem, please ensure that it is running";
else
echo -e "XMing is not installed on Windows Filesystem - please download and install from: \nhttps://sourceforge.net/projects/xming/";
exit 1;
fi
#locate Quake game data
if [ -f "/mnt/c/GOG Games/Quake/id1/PAK0.PAK" ] || [ -f "/mnt/c/quake/id1/pak0.pak" ]
then
echo "Quake game data found on Windows Filesystem";
else
echo -e "Quake game data not found on Windows Filesystem - please download and install one of the following: \n(Shareware Edition)http://www.quakeone.com/q1files/downloads/quake-shareware-setup-beta099a.exe \n(Full Game)https://www.gog.com/game/quake_the_offering";
exit 1;
fi
echo "**********Windows requirements satisifed*********"
echo ".............(This may take a while)............."
#install quake engine prereqs
echo "Installing Quake engine prereqs..."
apt-get -y -qq update
apt-get -y -qq upgrade
apt-get -y -qq install libxtst-dev x11proto-xf86dga-dev libxxf86dga-dev libxxf86vm-dev mesa-common-dev libglu1-mesa-dev quake lhasa build-essential
#acquire and build tyrquake engine
echo "Acquiring and building tyrquake engine..."
wget -q http://disenchant.net/files/engine/tyrquake-0.61.tar.gz
tar -xzf tyrquake-0.61.tar.gz
rm tyrquake-0.61.tar.gz
cd tyrquake-0.61
make -q
echo "**********Build successful**********"
#copy Quake game data
echo "Copying Quake game data to appropriate location"
if [ -f "/mnt/c/GOG Games/Quake/id1/PAK0.PAK" ]
then
cp -r "/mnt/c/GOG Games/Quake/id1/" /usr/share/games/quake/
mv /usr/share/games/quake/id1/PAK0.PAK /usr/share/games/quake/id1/pak0.pak
mv /usr/share/games/quake/id1/PAK1.PAK /usr/share/games/quake/id1/pak1.pak
else
cp -r /mnt/c/quake/id1/ /usr/share/games/quake/
fi
#setup display
#echo "Setting up Display"
export DISPLAY=localhost:0.0
export PATH=$PATH:/usr/games
#instructions to run quake
echo ***********Success************
echo -e "To run Quake, ensure Xming is running on Windows, and that you have a valid display set (export DISPLAY=localhost:0.0) \nNavigate to ./tyrquake-0.61/ directory and type: quake --engine ./tyr-quake -mem 16";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment