@@ -1,77 +1,101 @@
#!/bin/bash
# Date: (2011-16-02 08:37)
-# Last version: (2011-16-02 08:37)
+# Last version: see changelog
# Distribution used to test: Gentoo (x64)
# Author: redevizer
# License: Retail
-
+#
+# CHANGELOG
+# [redevizer] (2011-16-02 08:37)
+# Initial script.
+# [Dadu042] (2020-01-29 21:00)
+# Wine 1.3.12 -> 2.22
+# Disable POL_Install_vcrun2008
+# Demo v1.2 tested with success.
+
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
-
-TITLE="Need For Speed Carbon"
-PREFIX="NFSCarbon"
-WORKING_WINE_VERSION="1.3.12"
-
+
+TITLE="Need For Speed: Carbon"
+PREFIX="NFS_Carbon"
+WORKING_WINE_VERSION="3.20"
+
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TITLE" "EA Games" "" "N/A" "$PREFIX"
+
-
-select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
-
-#downloading specific Wine
-POL_SetupWindow_install_wine "$WORKING_WINE_VERSION"
-Use_WineVersion "$WORKING_WINE_VERSION"
+# Setting prefix path
+POL_Wine_SelectPrefix "$PREFIX"
-#fetching PROGRAMFILES environmental variable
-POL_LoadVar_PROGRAMFILES
+# Determine Architecture
+# POL_System_SetArch "amd64"
+POL_System_SetArch "x86"
+
+# Downloading wine if necessary and creating prefix
+POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
+
+Set_OS "winxp"
+
+POL_System_TmpCreate "$PREFIX"
+
-Choose between DVD and Digital Download version
-POL_SetupWindow_menu "What version do you have?" "Actions" "DVD~Digital Download" "~"
-
-if [ "$APP_ANSWER" == "DVD" ]; then
-GAME_MEDIAVERSION="DVD"
+# Fetching PROGRAMFILES environmental variable
+POL_LoadVar_PROGRAMFILES
+
+# Choose between DVD and Digital Download version
+POL_SetupWindow_menu "What version do you have?" "Actions" "DVD~Digital Download~Demo" "~"
+
+VERSION_INSTALLED="$APP_ANSWER"
+
+if [ "$VERSION_INSTALLED" == "DVD" ]; then
+ GAME_MEDIAVERSION="DVD"
else
-GAME_MEDIAVERSION="DD"
+ GAME_MEDIAVERSION="DD"
fi
-
-#Installing mandatory dependencies
+
+# Installing mandatory dependencies
POL_Call POL_Install_vcrun2005
-POL_Call POL_Install_vcrun2008
+# POL_Call POL_Install_vcrun2008
POL_Call POL_Install_dotnet20
POL_Call POL_Install_d3dx9
-
-
+
+################
+# GPU #
+################
+
+# Asking about memory size of graphic card
+POL_SetupWindow_VMS "128"
+
+# Set Graphic Card information keys for wine
+POL_Wine_SetVideoDriver
+
+# Useful for Nvidia GPUs
+# POL_Call POL_Install_physx
+
+#######################################
+# Main part of this script #
+#######################################
+
if [ "$GAME_MEDIAVERSION" == "DVD" ]; then
-#asking for CDROM and checking if its correct one
+# Asking for CDROM and checking if its correct one
POL_SetupWindow_message "Please insert $TITLE media into your DVD drive\\nif not already done."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "AutoRun.exe"
wine start /unix "$CDROM/AutoRun.exe"
POL_SetupWindow_message "Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to redo the installation." "$TITLE"
else
-#Asking then installing DDV of the game
+# Asking then installing DDV of the game
cd $HOME
POL_SetupWindow_browse "Please select your $TITLE Digital Download executable" "$TITLE"
SETUP_EXE="$APP_ANSWER"
wine start /unix "$SETUP_EXE"
POL_SetupWindow_message "Click on \\"Next\\" ONLY when the game installation is finished\\nor you will have to redo the installation." "$TITLE"
fi
-
-#asking about memory size of graphic card
-POL_SetupWindow_menu_list "How much memory does your graphics board have?\\n(minimum for this game : 128)" "$TITLE" "128-256-320-384-512-640-768-896-1024-1792-2048" "-" "256"
-VMS="$APP_ANSWER"
-
-cd "$WINEPREFIX/drive_c/windows/temp/"
-echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > vms.reg
-echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> vms.reg
-regedit vms.reg
-if [ "$VMS" -lt "128" ]; then
-POL_SetupWindow_message "This game will work correctly only with a graphic card with more than 128Mb of memory." "$TITLE"
-fi
-
-
-#widescreen question
-POL_SetupWindow_question "Do you want to play with widescreen resoution?\\nIf yes Universal Widescreen Patcher will be downloaded\\n\\n\\nWidescreen How-To:\\n * unzip is required\\n * Select $TITLE location\\n * Enter desidered resolution\\n * In game select 640x480 resolution - it will be your desidered resolution" "Widescreen"
+
+
+
+# Widescreen question
+POL_SetupWindow_question "Do you want to play with widescreen resolution?\\n(if yes, Universal Widescreen Patcher will be downloaded).\\n\\n\\nWidescreen How-To:\\n * unzip is required\\n * Select $TITLE location\\n * Enter desidered resolution\\n * In game select 640x480 resolution - it will be your desidered resolution" "Widescreen"
if [ $APP_ANSWER == "TRUE" ]; then
POL_SetupWindow_message "Please wait while Universal Widescreen Patcher is being downloaded (~300kb)." "$TITLE"
mkdir -p $WINEPREFIX/drive_c/windows/temp
@@ -82,16 +106,20 @@
wine start /unix uniws.exe
POL_SetupWindow_message "Widescreen How-To:\\n * unzip is required\\n * Select $TITLE location (DO NOT CHOOSE: FIND IT FOR ME\\n it might detect the nfsc.exe that is located on your DVD)\\n * Enter desidered resolution\\n * In game select 640x480 resolution - it will be your desidered resolution" "Widescreen"
fi
-
-#delete temporary files
+
+# Delete temporary files
rm -rf $WINEPREFIX/drive_c/windows/temp/*
-
-
-#making shortcut
-POL_SetupWindow_auto_shortcut "$PREFIX" "nfsc.exe" "$TITLE" "" ""
-Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"
-
-POL_SetupWindow_message "$TITLE has been installed successfully.\\nHope it works...\\nGood luck with the game ;)\\n\\nIf the game does not work, try applying NO-CD patch" "$TITLE"
-
+
+
+# Making shortcut
+
+if [ "$VERSION_INSTALLED" == "Demo" ]; then
+ POL_SetupWindow_auto_shortcut "$PREFIX" "nfsc_demo.exe" "$TITLE (demo)" "" "" "Game;"
+else
+ POL_SetupWindow_auto_shortcut "$PREFIX" "nfsc.exe" "$TITLE" "" "" "Game;"
+fi
+
+POL_SetupWindow_message "$TITLE has been installed successfully.\\nHope it works...\\nGood luck with the game ;)\\n\\nIf the game does not work, try applying NO-CD patch." "$TITLE"
+
POL_SetupWindow_Close
-exit
+exit
\ No newline at end of file