summarylogtreecommitdiffstats
path: root/sappy2006
blob: c3060337ebefc11332afa822ea140c0da80d072f (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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

# WINE Launcher script for Sappy 2006 :3
# TODO: report crash bugs for mod 17.1 and update package

export WINEPREFIX=~/.sappy2006
export SAVEFILE=$WINEPREFIX/savefile
export SAPPYDIR=/usr/share/sappy2006 # installation dir for AUR package

# configure all dlls
configure() {
    winetricks -q vb6run
    wine regsvr32 /s $SAPPYDIR/SSubTmr6.dll
    wine regsvr32 /s $SAPPYDIR/cPopMenu6.ocx
    wine regsvr32 /s $SAPPYDIR/timermm.dll
    wine regsvr32 /s $SAPPYDIR/vbalCbEx6.ocx
    wine regsvr32 /s $SAPPYDIR/vbalExpBar6.ocx
    touch $SAVEFILE # ensures that we don't repeat configuration process
}

if [ "$1" = "--mkpfx" ]; then # Force reconfigure prefix
    configure
    exit 0
elif [ "$1" = "--erase" ]; then # delete all data in prefix
    rm -rf $WINEPREFIX
    exit 0
elif [ "$1" = "--help" ]; then # show command info
    cat << EOF
Sappy2006 Linux Loader by Atapi/Sterophonick
Original Program: (c) 2006 Kawa and DJ ßouché

Usage:
    sappy2006 [--mkpfx] [--erase] [--help]

    --mkpfx: Re-configure WINE prefix
    --erase: Erase all data in WINE prefix
    --help: Show this screen

EOF
    exit 0
elif [ ! -f "$SAVEFILE" ]; then # first boot
    configure
else
    echo ""
fi

[[ "$1" == "" ]] && wine $SAPPYDIR/sappy.exe # no args
[[ "$1" != "" ]] && wine $SAPPYDIR/sappy.exe "$(winepath -w "$1")" # args