summarylogtreecommitdiffstats
path: root/maszyna.sh
diff options
context:
space:
mode:
authorMichał Lisowski2021-04-26 17:10:38 +0200
committerMichał Lisowski2021-04-26 17:10:38 +0200
commit683a9e554b9dc80c13e3297594a66db7a7b1b420 (patch)
tree5e65fb0f28ce65bef0adcd6117d64c571763413a /maszyna.sh
parent448a34fb06d8f4d751b23b28ed9a1194bd1e5117 (diff)
downloadaur-683a9e554b9dc80c13e3297594a66db7a7b1b420.tar.gz
Make use of included starte via wrapper script + wine
Diffstat (limited to 'maszyna.sh')
-rwxr-xr-xmaszyna.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/maszyna.sh b/maszyna.sh
new file mode 100755
index 000000000000..19ebeab236ca
--- /dev/null
+++ b/maszyna.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# Directories
+INSTALL_DIR='/opt/maszyna'
+LOCAL_DIR="${HOME}/.maszyna"
+
+mkdir -p $LOCAL_DIR
+
+# Copy starter binary and dependant DLLs
+FILES='Starter.exe libeay32.dll ssleay32.dll'
+for file in $FILES
+do
+ if [ ! -f ${LOCAL_DIR}/${file} ]
+ then
+ cp ${INSTALL_DIR}/${file} ${LOCAL_DIR}/
+ fi
+done
+
+# Link game executable
+if [ ! -L ${LOCAL_DIR}/eu07.exe ]
+then
+ ln -s ${INSTALL_DIR}/eu07 ${LOCAL_DIR}/eu07.exe
+fi
+
+# Link required data dirs/files
+DIRS="data dynamic models scenery shaders sounds textures"
+for dir in $DIRS
+do
+ if [ ! -d ${LOCAL_DIR}/${dir} ]
+ then
+ mkdir -p ${LOCAL_DIR}/${dir}
+ for i in ${INSTALL_DIR}/${dir}/*
+ do
+ ln -s ${i} ${LOCAL_DIR}/${dir}/$(basename ${i})
+ done
+ fi
+done
+
+# Create python virtual environment and install dependencies
+pushd ${LOCAL_DIR}
+virtualenv2 linuxpython64
+source linuxpython64/bin/activate
+pip2 install pillow
+popd
+
+# Launch the starter!
+pushd ${LOCAL_DIR}
+wine Starter.exe
+popd