Usage:
./switch.sh <version>
eg:
./switch.sh 1.05b
The old version files are removed, new version files copied and the wine registry is adjusted to a new saves folder, eg Saves/1.05b. Extra game files, such as ddraw.dll or dsound.dll etc are not touched.
Code: Select all
#!/bin/sh
wineprefix=~/wine/d2
savepath='D:\d2\Saves'
gamefiles="
Bnclient.dll
D2CMP.dll
D2Client.dll
D2Common.dll
D2DDraw.dll
D2Direct3D.dll
D2Game.dll
D2Gdi.dll
D2Glide.dll
D2Lang.dll
D2Launch.dll
D2MCPClient.dll
D2Multi.dll
D2Net.dll
D2VidTst.exe
D2Win.dll
D2gfx.dll
D2sound.dll
Diablo II.exe
Fog.dll
Game.exe
Patch_D2.mpq
SmackW32.dll
Storm.dll
binkw32.dll
ijl11.dll
"
if [ $# -eq 1 ]; then
ver=$1
else
echo "Usage: `basename $0` <version>" 1>&2
exit 1
fi
dir=Platforms/$ver
if [ -d "$dir" ]; then
rm -f $gamefiles
cp $dir/* .
WINEPREFIX=$wineprefix wineconsole REG ADD \
'HKEY_CURRENT_USER\Software\Blizzard Entertainment\Diablo II' \
/v "Save Path" /d "$savepath\\$ver" /f
echo "$ver" > ver
else
echo "Platform directory $dir not found" 1>&2
exit 2
fi
exit 0