Applications

Choose a category

accessories
Accessories
development
Development
education
Education
functions
Functions
games
Games
graphics
Graphics
internet
Internet
multimedia
Multimedia
office
Office
other
Other

Star Wars : Knights Of The Old Republic

Magic number : 12

#!/bin/bash
# Date : (2009-08-09 11-00)
# Last revision : (2009-09-02 17-30)
# Wine version used : N/A
# Distribution used to test : N/A
# Author : NSLW
# Licence : N/A
# Depend : N/A
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
#procedure for patching kotor
patch_kotor()
{
POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
wine "$APP_ANSWER"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
 
copy_cd()
{
POL_SetupWindow_message "Please insert $1 cd" "$TYTUL"
POL_SetupWindow_cdrom
POL_SetupWindow_wait_next_signal "Copying $1 CD" "$TYTUL"
cd "$WINEPREFIX/drive_c/windows/temp"
cd "$CDROM"
cp -fr * "$WINEPREFIX/drive_c/windows/temp/SWKOTOR"
chmod 777 "$WINEPREFIX/drive_c/windows/temp/SWKOTOR" -R
mv "$WINEPREFIX/drive_c/windows/temp/SWKOTOR/autorun.inf" "$WINEPREFIX/drive_c/windows/temp/SWKOTOR/autorun$2.inf"
cd "$WINEPREFIX/drive_c/windows/temp"
POL_SetupWindow_detect_exit
sleep 5
}
 
Get_Latest_Wine_Version()
{
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document="$REPERTOIRE/tmp/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
 
TYTUL="StarWars : Knights Of The Old Republic"
PREFIX="SWKotor"
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "LucasArts" "http://www.lucasarts.com/products/swkotor/" "GNU_Raziel and NSLW" "$PREFIX"
 
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
Use_WineVersion "$CHOSENWINEVERSION"
 
#asking about patching or updating Wine version
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
 
if [ "$APP_ANSWER" == "Patch game" ]; then
patch_kotor
fi
 
POL_SetupWindow_Close
exit
fi
 
POL_SetupWindow_prefixcreate
cd "$WINEPREFIX/drive_c/windows/temp"
mkdir "SWKOTOR"
 
copy_cd "first" "1"
copy_cd "second" "2"
copy_cd "third" "3"
copy_cd "fourth" "4"
 
CDROM="$WINEPREFIX/drive_c/windows/temp/SWKOTOR"
 
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" d:
 
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]" > cdrom.reg
echo "\"d:\"=\"cdrom\"" >> cdrom.reg
regedit cdrom.reg
sleep 5
 
Set_OS "winxp"
cd "$WINEPREFIX/drive_c/windows/temp/SWKOTOR"
 
cd "$CDROM"
wine "Setup.exe"
POL_SetupWindow_message "Click \"Next\" when installation will finish." "$TYTUL"
 
Set_Managed "On"
Set_DXGrab "On"
 
rm -fr "$WINEPREFIX/drive_c/windows/temp/SWKOTOR"
 
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/LucasArts/SWKotOR" "swkotor.exe" "SWKotor.xpm" "$TYTUL"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/LucasArts/SWKotOR" "swconfig.exe" "SWKotor_Config.xpm" "StarWars : Knights Of The Old Republic Configurator"
 
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
Set_WineVersion_Assign "$CHOSENWINEVERSION" "StarWars : Knights Of The Old Republic Configurator"
 
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
POL_SetupWindow_reboot
 
 
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ]; then
 
POL_SetupWindow_menu "What installer should do?" "Actions" "Let me choose patch manually~Download patch automatically" "~"
 
if [ "$APP_ANSWER" == "Let me choose patch manually" ]; then
patch_kotor
elif [ "$APP_ANSWER" == "Download patch automatically" ]
then
 
POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading SWKotOR1_03.exe" "$TYTUL"
cd "$WINEPREFIX/drive_c/windows/temp"
wget "ftp://ftp.lucasarts.com/patches/pc/SWKotOR1_03.exe"
POL_SetupWindow_detect_exit
 
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
wine "SWKotOR1_03.exe"
POL_SetupWindow_detect_exit
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
fi
 
fi
 
exit
Il n'y a rien à voir ici