Magic number : 51
#!/bin/bash
# Date : (2008-09-07 19-00)
# Last revision : (2010-09-07 19-00)
# Wine version used : 1.2
# Distribution used to test : Debian Squeeze (Testing)
# Author : GNU_Raziel
# Licence : Retail
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Command And Conquer 3 - Tiberium Wars - Kane Edition"
PREFIX="CommandAndConquer3-KaneEdition"
if [ "$POL_LANG" == "fr" ]; then
LNG_CHOOSE_LANG="Choisissez la langue que vous désirez pour le jeu"
LANG_FR="Français"
LANG_EN="Anglais"
LANG_DE="Allemand"
LNG_WAIT_END="Appuyez sur \"Suivant\" UNIQUEMENT quand l'installation du\njeu sera terminée sous peine de devoir recommencer l'installation."
LNG_WAIT_CONFIG="Patientez pendant la configuration du pack de language..."
LNG_CNC3_VMS="Quelle est la quantité de mémoire (Mo) de votre carte graphique ?\n(minimum pour ce jeu : 64)"
LNG_VMS_ERROR="Ce jeu ne fonctionnera correctement qu'avec une carte graphique ayant plus de 64Mo de mémoire."
else
LNG_CHOOSE_LANG="Choose the game language you want"
LANG_FR="French"
LANG_EN="English"
LANG_DE="German"
LNG_WAIT_END="Click on \"Next\" ONLY when the game installation is finished\nor you will have to redo the installation."
LNG_WAIT_CONFIG="Wait while language pack is configured..."
LNG_CNC3_VMS="How much memory does your graphics board have?\n(minimum for this game : 64)"
LNG_VMS_ERROR="This game will work correctly only with a graphic card with more than 64Mo of memory."
fi
cd $REPERTOIRE/tmp
rm *.jpg
wget http://files.playonlinux.com/resources/setups/cnc3/left.jpg
wget http://files.playonlinux.com/resources/setups/cnc3/top.jpg
POL_SetupWindow_Init "$REPERTOIRE/tmp/top.jpg" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "$TITLE" "Electronic Arts" "http://www.ea.com/cc/tiberium/" "GNU_Raziel" "$PREFIX"
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
#fetching PROGRAMFILES environmental variable
PROGRAMFILES="Program Files"
POL_LoadVar_PROGRAMFILES
#Choose Game language
POL_SetupWindow_menu "$LNG_CHOOSE_LANG" "$TITLE" "$LANG_FR~$LANG_EN~$LANG_DE" "~"
if [ "$APP_ANSWER" == "$LANG_FR" ]; then
GAME_LNG="fr"
elif [ "$APP_ANSWER" == "$LANG_DE" ]; then
GAME_LNG="de"
else
GAME_LNG="en"
fi
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
POL_Call POL_Install_gdiplus
POL_Call POL_Install_d3dx9
POL_Call POL_Install_msvc80
wine start /unix "$CDROM/autorun.exe"
POL_SetupWindow_message "$LNG_WAIT_END" "$TITLE"
if [ "$GAME_LNG" == "fr" ]; then
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CONFIG" "$TITLE"
cd $REPERTOIRE/tmp/
cabextract $CDROM/Langfr~1.cab
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Electronic Arts/Command & Conquer 3/"
mv $REPERTOIRE/tmp/cnc3_french_1.0.skudef CNC3_french_1.0.SkuDef
mv CNC3_english_1.0.SkuDef CNC3_english_1.0.SkuDef.save
cp CNC3_french_1.0.SkuDef CNC3_english_1.0.SkuDef
mkdir -p Lang-french/1.0
echo "add-big French.big" > Lang-french/1.0/config.txt
cp $REPERTOIRE/tmp/french.big Lang-french/1.0/French.big
mv Lang-english/1.0/English.big Lang-english/1.0/English-save.big
mv $REPERTOIRE/tmp/french.big Lang-english/1.0/English.big
echo "add-big ../Lang-french/1.0/French.big" >> RetailExe/1.0/config.txt
cat << EOF > $REPERTOIRE/tmp/french.reg
[HKEY_LOCAL_MACHINE\\Software\\Electronic Arts\\Command and Conquer 3]
"Language"="french"
"Locale"="fr_FR"
[HKEY_LOCAL_MACHINE\\Software\\Electronic Arts\\Electronic Arts\\Command and Conquer 3]
"Language"="french"
[HKEY_CURRENT_USER\\Software\\Electronic Arts\\Electronic Arts\\Command and Conquer 3]
"Language"="french"
EOF
regedit $REPERTOIRE/tmp/french.reg
POL_SetupWindow_detect_exit
fi
if [ "$GAME_LNG" == "de" ]; then
POL_SetupWindow_wait_next_signal "$LNG_WAIT_CONFIG" "$TITLE"
cd $REPERTOIRE/tmp/
cabextract $CDROM/Langge~1.cab
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Electronic Arts/Command & Conquer 3/"
mv $REPERTOIRE/tmp/cnc3_german_1.0.skudef CNC3_german_1.0.SkuDef
mv CNC3_english_1.0.SkuDef CNC3_english_1.0.SkuDef.save
cp CNC3_german_1.0.SkuDef CNC3_english_1.0.SkuDef
mkdir -p Lang-german/1.0
echo "add-big German.big" > Lang-german/1.0/config.txt
cp $REPERTOIRE/tmp/german.big Lang-french/1.0/German.big
mv Lang-english/1.0/English.big Lang-english/1.0/English-save.big
mv $REPERTOIRE/tmp/german.big Lang-english/1.0/English.big
echo "add-big ../Lang-german/1.0/German.big" >> RetailExe/1.0/config.txt
cat << EOF > $REPERTOIRE/tmp/german.reg
[HKEY_LOCAL_MACHINE\\Software\\Electronic Arts\\Command and Conquer 3]
"Language"="german"
"Locale"="de_DE"
[HKEY_LOCAL_MACHINE\\Software\\Electronic Arts\\Electronic Arts\\Command and Conquer 3]
"Language"="german"
[HKEY_CURRENT_USER\\Software\\Electronic Arts\\Electronic Arts\\Command and Conquer 3]
"Language"="german"
EOF
regedit $REPERTOIRE/tmp/german.reg
POL_SetupWindow_detect_exit
fi
Set_SoundDriver "alsa"
Set_Managed "On"
Set_DXGrab "On"
POL_SetupWindow_menu_list "$LNG_CNC3_VMS" "$TITLE" "32-64-128-256-384-512-768-1024-2048" "-" "64"
VMS="$APP_ANSWER"
if [ "$VMS" -lt "64" ]; then
POL_SetupWindow_message "$LNG_VMS_ERROR" "$TITLE"
fi
cat << EOF > $REPERTOIRE/tmp/vms.reg
[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]
"VideoMemorySize"="$VMS"
EOF
regedit $REPERTOIRE/tmp/vms.reg
cat << EOF > $REPERTOIRE/tmp/net_hack.reg
[HKEY_CURRENT_USER\\Software\\Wine\\Network]
"UseBindAddressHack"="enabled"
EOF
regedit $REPERTOIRE/tmp/net_hack.reg
cd $REPERTOIRE/tmp/
rm -rf *
cd $WINEPREFIX/drive_c/windows/temp/
rm -rf *
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Electronic Arts/Command & Conquer 3/" "CNC3.exe" "CommandAndConquer3.xpm" "$TITLE"
POL_SetupWindow_Close
exit