You are here > Les forums > Your creations. > [script] The Sims 3
| New topic - Reply |
| Author | Replies |
| NSLW | Wednesday 20 May 2009 at 21:13 - [Quote] |
Membre![]() ![]() |
Hello,
I wrote script which installs The Sims 3. It also can patch the game after it's been installed Wine version : 1.1.21 Distribution : Fedora Distribution Version : 10 (32 bit) Graphics card : Nvidia, GeForce 9xxx Drivers of the graphics card : 185.18.08 Comments -game won't run with original TS.exe Icon for the game:
#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
TYTUL="The Sims 3"
PREFIX="SIMS3"
#procedure for patching fallout
patch_sims3()
{
POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
wine "$APP_ANSWER"
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "Electronic Arts Inc." "thesims3.ea.com" "NSLW" "$PREFIX"
select_prefixe "$REPERTOIRE/wineprefix/$PREFIX"
#asking about patching
POL_SetupWindow_menu "What do you want to do?" "Actions" "install-game patch-game" " "
if [ "$APP_ANSWER" == "patch-game" ]; then
if [ -e "$REPERTOIRE/wineprefix/$PREFIX" ]; then
patch_sims3
fi
POL_SetupWindow_Close
fi
cd "$REPERTOIRE/ressources/"
#determining which Version is the latest
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document=LIST
cat LIST | sed -e 's/\.//g' | cut -d';' -f2 | sort -n | tail -n1 >& LatestVersion.txt
x=`cat LatestVersion.txt | cut -c1-1`
y=`cat LatestVersion.txt | cut -c2-2`
z=`cat LatestVersion.txt | cut -c3-4`
LATESTVERSION=$x.$y.$z
if [ "$LATESTVERSION" == "" ]; then
$LATESTVERSION="System"
else
POL_SetupWindow_install_wine $LATESTVERSION
fi
POL_SetupWindow_prefixcreate
#downloading .NET Framework 2.0
if [ ! -e "$HOME/.winetrickscache/dotnet20/dotnetfx.exe" ]
then
mkdir "$HOME/.winetrickscache"
mkdir "$HOME/.winetrickscache/dotnet20"
cd "$HOME/.winetrickscache/dotnet20"
POL_SetupWindow_download "PlayOnLinux is downloading .NET Framework" ".NET Framework 2.0" "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe"
POL_SetupWindow_download "PlayOnLinux is downloading .NET Framework" ".NET Framework 2.0" "http://kegel.com/wine/l_intl.nls"
fi
cd "$REPERTOIRE/ressources/"
#downloading winetricks
if [ ! -e "$REPERTOIRE/ressources/winetricks" ]
then
wget http://www.kegel.com/wine/winetricks --output-document=winetricks
fi
#installing .NET Framework 2.0
POL_SetupWindow_wait_next_signal "Installing .NET Framework 2.0..." "$TYTUL"
bash winetricks -q dotnet20
POL_SetupWindow_detect_exit
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Sims3Setup.exe"
#adding CD-ROM as drive d: to winecfg
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"
#starting installation
cd $CDROM
wine "Sims3Setup.exe"
POL_SetupWindow_message "Click \"Next\" when installation will finish." "$TYTUL"
cd "$WINEPREFIX/drive_c/windows/temp/"
#setting OffscreenRenderingMode to fbo
echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > fbo.reg
echo "\"OffscreenRenderingMode\"=\"fbo\"" >> fbo.reg
echo "\"Multisampling\"=\"enabled\"" >> fbo.reg
regedit fbo.reg
#asking about memory size
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]" > vms.reg
echo "\"VideoMemorySize\"=\"$VMS\"" >> vms.reg
regedit vms.reg
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Electronic Arts/The Sims 3/Game/Bin" "TS3.exe" "" "$TYTUL" "" ""
POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Electronic Arts/The Sims 3/Game/Bin" "Sims3Launcher.exe" "" "$TYTUL Launcher" "" ""
Set_WineVersion_Assign "$LATESTVERSION" "$TYTUL"
Set_WineVersion_Assign "$LATESTVERSION" "$TYTUL Launcher"
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_sims3
fi
POL_SetupWindow_Close
exit |
99 people online


