forked from TorchCraft/TorchCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick_setup.sh
executable file
·38 lines (32 loc) · 1.12 KB
/
quick_setup.sh
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
#!/bin/bash
WINE_DIR=${WINEPREFIX:-~/.wine}
TC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ `uname` == 'Darwin' ]]; then
SC_DIR="$(dirname $(find $WINE_DIR -name StarCraft.exe -print -quit))"
else
SC_DIR="$(dirname $(readlink -f $(find $WINE_DIR -name StarCraft.exe -print -quit)))"
fi
SC_DIR=${STARCRAFT_DIR:-$SC_DIR}
if [ ! -e $SC_DIR ]; then
echo "Cannot find StarCraft directory, try setting $STARCRAFT_DIR"
exit 1
fi
cd $SC_DIR
cp $TC_DIR/BWEnv/bin/*.exe ./
cp $TC_DIR/BWEnv/bin/*.dll ./
cp $TC_DIR/BWEnv/bin/*.sh ./
cp $TC_DIR/config/*.ini $SC_DIR/bwapi-data/
cp $TC_DIR/maps/micro/ $SC_DIR/Maps/BroodWar/ -r
curl -LO https://github.com/TorchCraft/TorchCraft/releases/download/v1.4-0/torchcraft-v1.4-0.zip
unzip torchcraft-v1.4-0.zip
cp torchcraft-v1.4-0/* ./
cp torchcraft-v1.4-0/bin/* ./
if [[ `uname` == 'Darwin' ]]; then
sed -i '' "s|^ai *=.*|ai=$SC_DIR/BWEnv.dll|" bwapi-data/bwapi.ini
else
sed -i "s|^ai *=.*|ai=$SC_DIR/BWEnv.dll|" bwapi-data/bwapi.ini
fi
# Set up the right registry keys
cd $WINE_DIR
cp user.reg user.reg.BAK # Make a backup
cat $TC_DIR/docker/common/regkeys >> user.reg