#!/bin/bash
#Vérifier que PlayOnLinux est bien exécuté avant
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
#Charger les librairies
source "$PLAYONLINUX/lib/sources"
#Verifier les dépendences
cfg_check
#presentation
cd $REPERTOIRE/tmp/
rm *.jpg
wget "$SITE/setups/tmnf/left.jpg"
wget "$SITE/setups/tmnf/top.jpg"
POL_SetupWindow_Init "$REPERTOIRE/tmp/top.jpg" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_presentation "TrackMania - Nations For Ever" "Focus Home Interactive" "http://www.trackmaniaunited.com/" "Tinou and Chriswill" "TMNations"
if [ "$POL_LANG" == "fr" ]; then
LNG_QUEST_TMN="Où se trouve le fichier d'installation de TrackMania - Nations Forever ?"
LNG_QUEST_DL="Le fichier d'installation de TrackMania Nations Forever est necessaire.\nAvant de continuer, assurez-vous de l'avoir téléchargé sur\nhttp://www.trackmaniaunited.com"
LNG_AVE_DX="Il est necessaire d'installer une version complète de directx pour assurer un fonctionnement correct du jeu."
LNG_DLL_DL="Téléchargement des Dll nécessaires..."
LNG_DLL_INST="Installation des Dll"
LNG_DLL_INSC="Inscription des Dll dans la base de registre"
LNG_DX_DL=" Téléchargement de Directx Mars 2008.....
L'installation débutera à la suite"
LNG_DX2_INST=" Une seconde installation de la même version de directx est nécessaire......"
LNG_TMN_INST="Cliquez pour commencer l'installation du jeu.
ATTENTION
A la fin du programme d'installation, Veillez à quitter sans lancer le jeu (case à décocher)"
LNG_REG_WINE="réglage des paramètres de wine pour l'utilisation du jeu"
LNG_SND_DL="Téléchargement et installation de la DLL gèrant le son"
LNG_PARAM_TMN="Un fichier Sounds_Settings comportant la configuration à appliquer pour le son a été créé
dans le dossier TrackMania de votre répertoire personnel ...."
else
LNG_QUEST_TMN="Where is the installation file of TrackMania - Nations Forever ?"
LNG_QUEST_DL="The Track mania Nations for ever file is needed before to continue....
did you download it ?
in case of not, click on no and go to http://www.trackmaniaunited.com/"
LNG_AVE_DX="It's necessary to install a complete version of directx to be sure that the game will run correctly"
LNG_DLL_DL="Downloading of necessary DLL ...."
LNG_DLL_INST="DLL installation ...."
LNG_DLL_INSC="DLL inscription in registry"
LNG_DX_DL=" Download of Directx Mars 2008 will begin.....
Installation of the game will begin after"
LNG_DX2_INST="Directx must be installed a second time......"
LNG_TMN_INST="Click on next to begin the game's installation.
BE CARREFULL
At the end of the installation's software, Do not run the game by put off the cross in the box"
LNG_REG_WINE="settings of wine to run the game"
LNG_SND_DL="Downloading and installation of the DLL file for the sound"
LNG_PARAM_TMN="A file named Sounds_Settings that include the settings for the sound was created
in the TrackMania's file of your personal's directory ...."
fi
# Avertissement
POL_SetupWindow_message "$LNG_QUEST_DL" "Track Mania Nations For Ever"
browser "http://www.trackmaniaunited.com"
#Préparation de Wine
mkdir -p $REPERTOIRE/wineprefix/TMNations
select_prefixe "$REPERTOIRE/wineprefix/TMNations"
POL_SetupWindow_prefixcreate
Set_OS "win2k"
POL_SetupWindow_reboot
#POL_SetupWindow_message "$LNG_AVE_DX" "Track Mania Nation For Ever"
#Directx
#####preparation
cd $REPERTOIRE/tmp
#POL_SetupWindow_message "$LNG_DLL_DL" "Track Mania Nation For Ever"
if [ ! -e $REPERTOIRE/tmp/mscoree.dll.zip ]; then
POL_SetupWindow_download "Dowlading libraries..." "Track Mania Nation For Ever" "http://www.dllbank.com/zip/m/mscoree.dll.zip" ""
fi
if [ ! -e $REPERTOIRE/tmp/streamci.dll.zip ]; then
POL_SetupWindow_download "Dowlading libraries..." "Track Mania Nation For Ever" "http://www.dllbank.com/zip/s/streamci.dll.zip"
fi
cd $REPERTOIRE/wineprefix/TMNations/drive_c/windows/system32/
#POL_SetupWindow "$LNG_DLL_INST" "" 7 17
unzip $REPERTOIRE/tmp/mscoree.dll.zip
unzip $REPERTOIRE/tmp/streamci.dll.zip
POL_SetupWindow_install_wine "0.9.58"
POL_SetupWindow_wait_next_signal "Registering DLLs" "Track Mania Nation For Ever"
#inscription des dll de directx
echo "[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]" > $REPERTOIRE/tmp/dll.reg
echo "\"fusion\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3d8\"=\"builtin\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3d9\"=\"builtin\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3dim\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3drm\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3dx8\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"d3dxof\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dciman32\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"ddrawex\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"devenum\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dinput\"=\"builtin\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dinput8\"=\"builtin\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmband\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmcompos\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmime\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmloader\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmscript\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmstyle\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmsynth\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmusic\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dmusic32\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dnsapi\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dplay\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dplayx\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dpnaddr\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dpnet\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dpnhpast\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dpnlobby\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dsound\"=\"builtin\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dswave\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"dxdiagn\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"mscoree\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"msdmo\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"qcap\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"quartz\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
echo "\"streamci\"=\"native\"" >> $REPERTOIRE/tmp/dll.reg
cd $REPERTOIRE/tmp
#message "$LNG_DLL_INSC" "" 8 17
regedit dll.reg
POL_SetupWindow_detect_exit
####installation
cd $REPERTOIRE/tmp
#message "$LNG_DX_DL" "" 9 17
if [ ! -e $REPERTOIRE/tmp/directx_mar2008_redist.exe ]; then
POL_SetupWindow_download "Downlaoding Directx 9.0c mars 2008..." "Track Mania Nation For Ever" "http://download.microsoft.com/download/6/4/c/64c3d3d6-c5da-47eb-9db4-86e45b9f579e/directx_mar2008_redist.exe" ""
fi
POL_SetupWindow_wait_next_signal "Installing DirectX patch" "Track Mania Nation For Ever"
mkdir directx_tmp
cabextract directx_mar2008_redist.exe -d $REPERTOIRE/tmp/directx_tmp
cd directx_tmp
wine DXSETUP.exe /silent
POL_SetupWindow_detect_exit
###seconde installation
#message "$LNG_DX2_INST" "" 11 17
wine DXSETUP.exe /silent
POL_SetupWindow_detect_exit
POL_SetupWindow_reboot
# installation Track Mania
#message "$LNG_TMN_INST" "" 12 17
POL_SetupWindow_browse "$LNG_QUEST_TMN" "Track Mania Nation For Ever"
CHEMIN="$APP_ANSWER"
POL_SetupWindow_wait_next_signal "Installing Track Mania Nation For Ever" "Track Mania Nation For Ever"
#CHEMIN=$(selectionner_fichier "$LNG_QUEST_TMN" "" 13 17)
wine "$CHEMIN"
POL_SetupWindow_detect_exit
#reglage de wine
POL_SetupWindow "$LNG_REG_WINE" "Track Mania Nation For Ever"
Set_SoundDriver "oss"
echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > $REPERTOIRE/tmp/reglages.reg
echo "\"DirectDrawRenderer\"=\"opengl\"" >> $REPERTOIRE/tmp/reglages.reg
echo "\"OffscreenRenderingMode\"=\"backbuffer\"" >> $REPERTOIRE/tmp/reglages.reg
echo "\"PixelShaderMode\"=\"disabled\"" >> $REPERTOIRE/tmp/reglages.reg
echo "\"RenderTargetLockMode\"=\"auto\"" >> $REPERTOIRE/tmp/reglages.reg
echo "\"UseGLSL\"=\"enabled\"" >> $REPERTOIRE/tmp/reglages.reg
cd $REPERTOIRE/tmp
regedit reglages.reg
#déplacement de d3dx9_36.dll et d3dx30_30.dll
cp $REPERTOIRE/wineprefix/TMNations/drive_c/windows/system32/d3dx9_36.dll $REPERTOIRE/wineprefix/TMNations/drive_c/Program\ Files/TmNationsForever/
cp $REPERTOIRE/wineprefix/TMNations/drive_c/windows/system32/d3dx9_30.dll $REPERTOIRE/wineprefix/TMNations/drive_c/Program\ Files/TmNationsForever/
#remplacement de la dll existente
#message "$LNG_SND_DL" "" 15 17
#cd $REPERTOIRE/wineprefix/TMNations/drive_c/Program\ Files/TmNationsForever/
#mv OpenAL32.dll OpenAL32.dll.old
#telecharger "OPenAL32.dll" "http://schmatzler.de/openal32.dll" "" 16 17
#mv openal32.dll OpenAL32.dll
POL_SetupWindow_detect_exit
cd $REPERTOIRE/wineprefix/TMNations/drive_c/Program\ Files/TmNationsForever/
POL_SetupWindow_download "Downloading wrap_oal.dll" "Track Mania Nations Forever" "$SITE/dlls/wrap_oal.dll"
#CREATION LANCEUR
POL_SetupWindow_make_shortcut "TMNations" "Program Files/TmNationsForever" "TmForeverLauncher.exe" "" "Track Mania Nations For Ever"
Set_WineVersion_Assign "0.9.58" "Track Mania Nations For Ever"
#paramétrage Jeu
#attention "$LNG_PARAM_TMN" "" 17 17
cd $HOME/TrackMania
#francais
echo "" >> SoundsSettings.txt
echo "au démarrage du jeu, un lanceur apparaît. Cliquez sur configurer > avancé > Audio (onglet)" > SoundsSettings.txt
echo "Materiel Audio = défaut , Qualité = Basse , décochez les autres cases " >> SoundsSettings.txt
echo "Cliquez sur sauvegarder par la suite" >> SoundsSettings.txt
#english
echo "" >> SoundsSettings.txt
echo "" >> SoundsSettings.txt
echo "When the game begins, a window appears. Click on Settings > Advanced > Sound (tab)" >> SoundsSettings.txt
echo "Audio Hardware = default , Quality = low , shoot the others crosses " >> SoundsSettings.txt
echo "click on save after...." >> SoundsSettings.txt
POL_SetupWindow_message "Track Mania Nation Forever has been successfully installed" "Track Mania Nation For Ever"
POL_SetupWindow_Close
exit