summarylogtreecommitdiffstats
path: root/knyttstories
blob: 0ce11851aa06fff7f77f04f2e7c06eb198ec3115 (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
#!/bin/bash
export WINEPREFIX="$HOME/.knyttstories/wine"

# Before running the game for the first time, some stuff needs to be done.

# Set some symlinks and prepare the game environment.
if [ ! -d "$HOME"/.knyttstories ] ; then
  mkdir -p "$HOME"/.knyttstories/{wine,Saves} || exit 1
  ln -s /usr/share/knyttstories/"Knytt Stories".exe "$HOME"/.knyttstories/knyttstories || exit 1
  ln -s /var/games/knyttstories/Worlds "$HOME"/.knyttstories/Worlds || exit 1
  cp -r /usr/share/knyttstories/Data "$HOME"/.knyttstories/ || exit 1
fi

# We need the system32 directory to exist prior to attempting to copy the requireddll file.
if [ ! -d "$HOME"/.knyttstories/wine/drive_c/windows/system32 ]; then
  mkdir -p "$HOME"/.knyttstories/wine/drive_c/windows/system32 || exit 1
fi

# Copy the msvcp60.dll file to the system32 directory or the game won't run
if [ ! -f "$HOME"/.knyttstories/wine/drive_c/windows/system32/msvcp60.dll ]; then
  ln -s /usr/share/knyttstories/msvcp60.dll "$HOME"/.knyttstories/wine/drive_c/windows/system32/msvcp60.dll || exit 1
fi

# Run the game
wine "$HOME"/.knyttstories/knyttstories "$@"