summarylogtreecommitdiffstats
path: root/supercard-sd
blob: 2df350e849fd48501090654f9f2a0a6bf9d6ce4b (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 SuperCard SD software

export WINEPREFIX=~/.supercard-sd
export SAVEFILE=$WINEPREFIX/savefile
export SCDIR=/usr/share/supercard-sd # installation dir for AUR package

# configure registry
configure() {
    # configure hkcu
    wine reg ADD HKCU\\Software\\SuperCard\\sc /v OUTPATH /t REG_SZ /d "Z:\\home\\$(whoami)\\Documents\\SuperCard" /reg:32 /f
    wine reg ADD HKCU\\Software\\SuperCard\\sc /v LANGUAGE /t REG_DWORD /d 0 /reg:32 /f
    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
SuperCard SD Linux Loader by Atapi/Sterophonick
Original Program: (c) 200? SuperCard

Output files are by default put in ~/Documents/SuperCard

Usage:
    supercard-sd [--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

mkdir /home/$(whoami)/Documents/SuperCard
cd $SCDIR # We must change our directory because it asks for a LANGUAGE.INI in the current working directory for some reason. I had to strace it to find this.
wine SuperCardsd.exe # no args