summarylogtreecommitdiffstats
path: root/gog-bg-config
blob: e472b038983d7cc02a408b53bc365eb11aa29034 (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
#!/usr/bin/bash
ID=baldurs-gate
WRITABLE='*.ini *.key *.tlk'
EXE=Config.exe
USERDIR=$HOME/.gog/$ID
export WINEPREFIX=$USERDIR/.wine
export WINEDEBUG=-all

if ! [ -d $USERDIR ]
then
    INSTALLDIR=/opt/gog/$ID
    mkdir -p $(dirname $USERDIR)
    cp -as $INSTALLDIR $USERDIR
    WINEARCH=win32 wineboot -i
    rm $WINEPREFIX/dosdevices/"z:"
    ln -s $USERDIR $WINEPREFIX/drive_c
    cd $USERDIR
    for file in $WRITABLE
    do
	cp -a --remove-destination $INSTALLDIR/$file $file
    done
fi

cd $WINEPREFIX/drive_c/$ID
wine $EXE