summarylogtreecommitdiffstats
path: root/th07.sh
blob: 026bde26054e43a4ec6edb5db6822cc94d4b9896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
export WINEPREFIX="$HOME/.th07/wine"
export WINEDLLOVERRIDES="mscoree=;mshtml="

if [ ! -d "$HOME"/.th07 ] ; then
  mkdir -p "$HOME"/.th07/wine || exit 1
  ln -s /usr/share/th07/th07.exe "$HOME"/.th07/th07.exe || exit 1
  ln -s /usr/share/th07/custom.exe "$HOME"/.th07/custom.exe || exit 1
  ln -s /usr/share/th07/th07tr.dat "$HOME"/.th07/th07tr.dat || exit 1
fi

if [ ! -f "$HOME"/.th07/th07.cfg ] ; then
  echo "AAABAAIABAD//////////wMAAAACAAcAWAJYAgIDAAIBAQAAAgABAAAAAAAAAAAAAAAAAAEIAAA=" |base64 -d > "$HOME"/.th07/th07.cfg || exit 1
fi

if [ -n "`whereis timidity|grep '/usr/bin'`" ] ; then
  if [ -z "`ps -A|grep timidity`" ] ; then
    timidity -iA &
    timiditypid=$!
  fi
fi

CFG=$(base64 ~/.th07/th07.cfg)
echo $CFG|sed 's/.\(....\)$/I\1/' |base64 -d > ~/.th07/th07.cfg
cd ~/.th07
if [ -e "$HOME"/.th07/th07e.exe ]; then
  wine "$HOME"/.th07/th07e.exe "$@"
fi
if [ ! -e "$HOME"/.th07/th07e.exe ]; then
  wine "$HOME"/.th07/th07.exe "$@"
fi
if [ -n "$timiditypid" ]; then
  kill $timiditypid
fi