Forum

[script] Need For Speed: Underground

Författare Svar
NSLW Wednesday 6 May 2009 at 19:35
NSLW

Hello,
I've made script which installs Need For Speed: Underground. It works on
Wine version : 1.1.20
Distribution : Fedora
Distribution Version : 10 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 185.18.08
Known Issues
-game won't run with original Speed.exe
-drag races won't work

Icon for the game:


#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

VERSIONWINE=$(wine --version)
TYTUL="Need For Speed: Underground"
PREFIX="NFSUnderground"
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "EA Games" "N/A" "NSLW" "$PREFIX" 

select_prefixe "$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_prefixcreate

POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "AutoRun.exe"

cd $WINEPREFIX/dosdevices
ln -s $CDROM d:

echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > $REPERTOIRE/tmp/cdrom.reg
echo "\\"d:\\"=\\"cdrom\\"" >> $REPERTOIRE/tmp/cdrom.reg
regedit $REPERTOIRE/tmp/cdrom.reg

POL_SetupWindow_message "Wait 5 seconds then click next" "$TYTUL"

POL_SetupWindow_menu "What language do you prefer?" "Language" "English German Spanish Italian Swedish French Dutch Korean Chinese Finnish Danish PortBrzl Czech Hebrew Greek Japanese Russian Polish Thai Norwegian Portuguese" " "

if [ "$APP_ANSWER" == "English" ]; then
echo English
elif [ -e "$CDROM/Languages/$APP_ANSWER.bin" ]
then
cp -f "$CDROM/Languages/$APP_ANSWER.bin" "$WINEPREFIX/drive_c/windows/temp/English.bin"
APP_ANSWERUPPERCASE="`echo $APP_ANSWER|tr '[:lower:]' '[:upper:]'`"
cp -f "$CDROM/Languages/LANGUAGE_$APP_ANSWERUPPERCASE.bin" "$WINEPREFIX/drive_c/windows/temp/LANGUAGE_ENGLISH.bin"
else
echo "No such language"
fi

POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"

cp "$CDROM/NFSU_icon.ico" "$REPERTOIRE/icones/32/$TYTUL"

cd $CDROM
wine $CDROM/AutoRun.exe

POL_SetupWindow_detect_exit

POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

if [ -e "$WINEPREFIX/drive_c/windows/temp/English.bin" ];
then
cp -f "$WINEPREFIX/drive_c/windows/temp/English.bin" "$WINEPREFIX/drive_c/Program Files/EA GAMES/Need For Speed Underground/Languages/English.bin"

cp -f "$WINEPREFIX/drive_c/Program Files/EA GAMES/Need For Speed Underground/Languages/LANGUAGE_ENGLISH.bin"

else
echo "English"
fi


cd $REPERTOIRE/ressources/

if [ ! -e $REPERTOIRE/ressources/dinput8.zip ]; then
POL_SetupWindow_download "PlayOnLinux is downloading dinput8,dll" "$TYTUL" "http://www.useyourbrain.co.uk/dlldownloads-files/dinput8.zip"
fi

cd $WINEPREFIX/drive_c/windows/temp/
unzip $REPERTOIRE/ressources/dinput8.zip
cp DINPUT8.DLL $WINEPREFIX/drive_c/windows/system32/


echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]" > $REPERTOIRE/tmp/override.reg
echo "\\"dinput8\\"=\\"native\\"" >> $REPERTOIRE/tmp/override.reg
regedit $REPERTOIRE/tmp/override.reg

POL_SetupWindow_menu_list "How much memory do your graphic card have got" "$TYTUL" "32-64-128-256-384-512-768-1024-2048" "-" "256"
VMS="$APP_ANSWER"
 
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > $REPERTOIRE/tmp/vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> $REPERTOIRE/tmp/vms.reg
regedit $REPERTOIRE/tmp/vms.reg
echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > $REPERTOIRE/tmp/d3d.reg
echo "\\"OffscreenRenderingMode\\"=\\"fbo\\"" >> $REPERTOIRE/tmp/d3d.reg
echo "\\"UseGLSL\\"=\\"enabled\\"" >> $REPERTOIRE/tmp/d3d.reg
regedit $REPERTOIRE/tmp/d3d.reg

cd $REPERTOIRE
rm -rf $WINEPREFIX/drive_c/windows/temp/*

POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Need For Speed Underground" "Speed.exe" "" "$TYTUL" ""

POL_SetupWindow_menu "What patch would you like to apply?" "Patch" "Europe Korean Chinese English-US" " "

cd $WINEPREFIX/drive_c/windows/temp/

if [ "$APP_ANSWER" == "Korean" ]; then
if [ ! -e "$WINEPREFIX/drive_c/windows/temp/NFSU_KOREA_PATCH_4.exe" ]; then
POL_SetupWindow_download "PlayOnLinux is downloading patch for $TYTUL" "$TYTUL" "ftp://ftp.ea.com/pub/ea/patches/nfs-underground/pc/korea/NFSU_KOREA_PATCH_4.exe"
fi
wine NFSU_KOREA_PATCH_4.exe

elif [ "$APP_ANSWER" == "Chinese" ]
then
	if [ ! -e "$WINEPREFIX/drive_c/windows/temp/NFSU_CHINESE_PATCH_4.exe" ]; then
	POL_SetupWindow_download "PlayOnLinux is downloading patch for $TYTUL" "$TYTUL" "ftp://	ftp.ea.com/pub/ea/patches/nfs-underground/pc/taiwan/NFSU_CHINESE_PATCH_4.exe"
	fi
	wine NFSU_CHINESE_PATCH_4.exe

elif [ "$APP_ANSWER" == "English-US" ]
then
	if [ ! -e "$WINEPREFIX/drive_c/windows/temp/NFSU_US_PATCH_4.exe" ]; then
POL_SetupWindow_download "PlayOnLinux is downloading patch for $TYTUL" "$TYTUL" "ftp://ftp.ea.com/pub/ea/patches/nfs-underground/pc/en-us/NFSU_US_PATCH_4.exe"
	fi
wine NFSU_US_PATCH_4.exe

elif [ "$APP_ANSWER" == "Europe" ]
then
	if [ ! -e "$WINEPREFIX/drive_c/windows/temp/NFSU_EUROPE_PATCH_4.exe" ]; then
POL_SetupWindow_download "PlayOnLinux is downloading patch for $TYTUL" "$TYTUL" "ftp://ftp.ea.com/pub/ea/patches/nfs-underground/pc/en-uk/NFSU_EUROPE_PATCH_4.exe"
	fi
wine NFSU_EUROPE_PATCH_4.exe
fi

POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"

POL_SetupWindow_Close
exit
GNU_Raziel Wednesday 20 May 2009 at 14:55
GNU_Raziel

Script added to repository, thx for your work :)