#!/bin/sh

if test -d "$1"
then
winedir="$1"
else
winedir="$HOME/.wine"
fi

# v pripade problemov odkomentovat:
# rm -rf $winedir

export WINEPREFIX="$winedir"
sh ./wine.res/winetricks msxml3 tahoma
cp ./wine.res/vgafix.fon "$winedir/drive_c/windows/Fonts/VGAFIX.FON"

# v pripade problemov so zvukovym zariadenim odkomentovat:
# wine regedit ./wine.res/vgafix.reg ./wine.res/audiofix.reg

cp -p -r -t "$winedir/drive_c" ./pmd85emu

echo "wine $winedir/drive_c/pmd85emu/PMD85Emu.exe" > run.sh
chmod 777 run.sh

sh ./run.sh

