#!/bin/bash # Licenced under the GNU General Public License, version 2 echo "ra2inst 2.0 by Alexander N. Sørnes, 2006"; echo echo "Get the latest version from"; echo "http://www.thehandofagony.com/alex/redalert2/"; echo "Send comments and suggestions to alex@thehandofagony.com"; echo echo "This script can install C&C: Red Alert 2 and"; echo "Westwood Shared Internet Components."; echo "A game CD is required."; echo echo if ! type wine > /dev/null; then echo "Could not execute 'wine'. Is it installed?"; exit; fi if ! type cabextract > /dev/null; then echo "You need the 'cabextract' utility."; exit; fi echo "Install Red Alert 2? (ENTER = yes, others = no)"; read RA2 echo echo "Install Westwood Shared Internet Components? (ENTER = yes, others = no)"; read WOL echo if [ $WOL ] && [ $RA2 ]; then echo "Nothing to do, then."; exit; fi echo "What is your CD mountpoint?" read CDROM echo if ! [ -d $CDROM/INSTALL ]; then echo "'$CDROM' does not contain a Red Alert 2 CD!"; exit; fi WINEINS="C:\\\Westwood\\\RA2"; echo if [ -z `winepath -u $WINEINS` ]; then mkdir `winepath -u "C:\\Westwood"`; fi INSINTO=`winepath -u $WINEINS` if ! [ $RA2 ]; then echo "Red Alert 2 will now be installed in C:\\Westwood\\RA2." echo "($INSINTO)" echo "Creating installation directory . . ."; mkdir -p $INSINTO echo "Copying files . . ."; cp -r $CDROM/INSTALL/{rmcache,Taunts} $INSINTO/ cp $CDROM/INSTALL/{00000409.016,00000409.256,BINKW32.DLL,Blowfish.dll,Blowfish.tlb,drvmgt.dll,game.exe,launcher.bmp,mph.exe,notes.ico,patchget.dat,PATCHW32.DLL,Ra2.exe,RA2.ico,ra2.ini,Ra2.lcf,Ra2.tlb,README.doc,README.txt,secdrv.sys,Uninst.exe,uninstll.exe} $INSINTO/ cabextract $CDROM/INSTALL/Game1.CAB -d $INSINTO echo "Adjusting permissions . . ."; chmod +w -R $INSINTO echo "Creating registry file . . ."; echo "[HKEY_LOCAL_MACHINE\Software\Westwood\Red Alert 2]" > ra2inst.reg echo "\"Name\"=\"Red Alert 2\"" >> ra2inst.reg echo "\"InstallPath\"=\"$WINEINS\\\RA2.EXE\"" >> ra2inst.reg echo "\"FolderPath\"=\"" >> ra2inst.reg echo "\"SKU\"=dword:00021002" >> ra2inst.reg echo "\"Version\"=dword:00010000" >> ra2inst.reg echo "\"Serial\"=\"\"" >> ra2inst.reg echo "Installing registry file . . ."; wine regedit ra2inst.reg rm ra2inst.reg fi if ! [ $WOL ]; then WOLINS="C:\\\Westwood\\\Internet"; WOLPATH=`winepath -u $WOLINS`; echo "Westwood Online will now be installed into C:\\Westwood\\Internet"; echo "($WOLPATH)"; echo "Creating directory."; mkdir $WOLPATH echo "Copying files . . ."; cp $CDROM/WOLAPI/* $WOLPATH/ echo "Adjusting permissions . . ."; chmod +w -R $WOLPATH echo "Creating registry files . . ."; echo "[HKEY_LOCAL_MACHINE\Software\Westwood\Register]" > register.reg echo "\"FolderPath\"=\"\"" >> register.reg echo "\"InstallPath\"=\"$WOLINS\\\Register.EXE\"" >> register.reg echo "\"Name\"=\"Internet Registration\"" >> register.reg echo "\"SKU\"=dword:000007e00" >> register.reg echo "\"Version\"=dword:000010001" >> register.reg echo "[HKEY_LOCAL_MACHINE\Software\Westwood\WOLAPI]" > wolapi.reg echo "\"FolderPath\"=\"\"" >> wolapi.reg echo "\"InstallPath\"=\"$WOLINS\\\WOLAPI.DLL\"" >> wolapi.reg echo "\"Name\"=\"Shared Internet Components\"" >> wolapi.reg echo "\"SKU\"=dword:00007f00" >> wolapi.reg echo "\"Usage\"=dword:00000000" >> wolapi.reg echo "\"Version\"=dword:0001000d" >> wolapi.reg echo "Installing registry files . . ." wine regedit register.reg wine regedit wolapi.reg rm register.reg wolapi.reg echo "Registering WOLAPI.DLL . . ." cd "$WOLPATH" wine regsvr32 WOLAPI.DLL fi echo "Done.";