Forums

[script] Croc Legend of the Gobbos

Auteur Réponses
NSLW Vendredi 7 Mai 2010 à 21:03
NSLW

Hello,
I wrote script which installs Croc Legend of the Gobbos.
Wine version : 1.1.43
Distribution : Fedora
Distribution Version : 12 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 195.36.15

Icon for the game:


#!/bin/bash
# Date : (2010-05-01 18-00)
# Last revision : (2010-05-01 18-00)
# Wine version used : 1.1.43
# Distribution used to test : Fedora 12
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick, unzip

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TYTUL="Croc Legend of the Gobbos"
PREFIX="CrocI"
WORKINGWINEVERSION="1.1.43"

POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
rm -f "$REPERTOIRE/icones/$1.ico"
}

#starting the script
wget http://upload.wikimedia.org/wikipedia/en/9/9c/Croc_Legend_of_the_Gobbos.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"

POL_SetupWindow_presentation "$TYTUL" "Argonaut Software" "N/A" "NSLW" "$PREFIX" 

select_prefix "$REPERTOIRE/wineprefix/$PREFIX"

#asking for CDROM and checking if it's correct one
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "./Setup/Setup.exe"

#downloading specific Wine
POL_SetupWindow_install_wine "1.1.2"
POL_SetupWindow_install_wine "$WORKINGWINEVERSION"
Use_WineVersion "$WORKINGWINEVERSION"

#creating application's own prefix
POL_SetupWindow_prefixcreate

#fetching PROGRAMFILES environmental variable
PROGRAMFILES="Program Files" 
POL_LoadVar_PROGRAMFILES

#adding CD-ROM as drive e: to winecfg
cd "$WINEPREFIX/dosdevices"
ln -s "$CDROM" e:

cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > cdrom.reg
echo "\\"e:\\"=\\"cdrom\\"" >> cdrom.reg
regedit cdrom.reg
sleep 5

#starting installation
wine start /unix "$CDROM/Setup/Setup.exe"
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"

#asking about memory size of graphic card
POL_SetupWindow_menu_list "How much memory do your graphic card have got?" "$TYTUL" "32-64-128-256-384-512-768-890-1024-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

#setting Glide compatible with Voodoo
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Argonaut Software\\\\Croc]" > glide.reg
echo "\\"Driver name\\"=\\"3dfx_win\\"" >> glide.reg
regedit glide.reg

cd "$REPERTOIRE/ressources"
#downloading Zeckensack's Glide wrapper
if [ ! -e "GlideWrapper084c.exe" ]; then
POL_SetupWindow_download "PlayOnLinux is downloading Zeckensack's Glide wrapper" "Zeckensack's Glide wrapper" "http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe"
fi
#downloading dgVoodoo Glide wrapper
if [ ! -e "dgVoodoo1.50Beta2.zip" ]; then
POL_SetupWindow_download "PlayOnLinux is downloading dgVoodoo Glide wrapper" "dgVoodoo Glide wrapper" "http://dege.freeweb.hu/dgVoodoo1.50Beta2.zip"
fi

#installing Zeckensack's Glide wrapper
POL_SetupWindow_wait_next_signal "Installation in progress..." "Zeckensack's Glide wrapper"
wine GlideWrapper084c.exe
POL_SetupWindow_detect_exit

#installing dgVoodoo Glide wrapper
POL_SetupWindow_wait_next_signal "Installation in progress..." "Zeckensack's Glide wrapper"
cd "$WINEPREFIX/drive_c/$PROGRAMFILES/Fox/Croc"
mv *lide2x.dll glide2x.dll.org
unzip "$REPERTOIRE/ressources/dgVoodoo1.50Beta2.zip"
mv glide2x.dll glide2x.dll.dgVoodoo #default Glide wrapper will be Zeckensack
POL_SetupWindow_detect_exit

#preparing Wine version
cd "$REPERTOIRE/WineVersions"
cp "$WORKINGWINEVERSION" "$WORKINGWINEVERSION-Croc"
rm -f "./$WORKINGWINEVERSION-Croc/usr/lib/wine/wined3d.dll.so"
rm -f "./$WORKINGWINEVERSION-Croc/usr/lib/wine/ddraw.dll.so"

cp "./$WORKINGWINEVERSION/usr/lib/wine/wined3d.dll.so" "./$WORKINGWINEVERSION-Croc/usr/lib/wine/wined3d.dll.so"
cp "./$WORKINGWINEVERSION/usr/lib/wine/ddraw.dll.so" "./$WORKINGWINEVERSION-Croc/usr/lib/wine/ddraw.dll.so"

#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *

#making shortcut 
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Fox/Croc" "CrocRun.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION-Croc" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "*_crocrun.0.xpm"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/GlideWrapper" "configurator.exe" "" "Croc Zeckensack configurator" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION-Croc" "Croc Zeckensack configurator"

#Adding configurator for changing Glide wrappers
cat << EOF > "$REPERTOIRE/configurations/configurators/$TYTUL"
#!/bin/bash
source "$PLAYONLINUX/lib/sources"

POL_SetupWindow_Init
cd "$REPERTOIRE/configurations/installed"
if [ -e "Croc Zeckensack configurator" ]; then
rm -f "Croc Zeckensack configurator"
mv "$WINEPREFIX/drive_c/$PROGRAMFILES/Fox/Croc/glide2x.dll.dgVoodoo" "$WINEPREFIX/drive_c/$PROGRAMFILES/Fox/Croc/glide2x.dll"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Fox/Croc" "dgVoodooSetup.exe" "" "Croc dgVoodoo configurator" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION-Croc" "Croc dgVoodoo configurator"

elif [ -e "Croc dgVoodoo configurator" ]; then
rm -f "Croc dgVoodoo configurator"
mv "$WINEPREFIX/drive_c/$PROGRAMFILES/Fox/Croc/glide2x.dll" "$WINEPREFIX/drive_c/$PROGRAMFILES/Fox/Croc/glide2x.dll.dgVoodoo"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/GlideWrapper" "configurator.exe" "" "Croc Zeckensack configurator" "" ""
Set_WineVersion_Assign "$WORKINGWINEVERSION-Croc" "Croc Zeckensack configurator"
fi
POL_SetupWindow_Close

EOF

POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

#asking about NVIDIA GeForce 4
POL_SetupWindow_question "Do you've got NVIDIA GeForce 4 graphic card?" "$TYTUL" 
if [ "$APP_ANSWER" == "TRUE" ] ;then

cd "$WINEPREFIX/drive_c/windows/temp/"
#setting D3DHW
echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Argonaut Software\\\\Croc]" > glide.reg
echo "\\"Driver name\\"=\\"d3drend\\"" >> glide.reg
regedit glide.reg

else
POL_SetupWindow_message_image "If you want high screen resolution you must change Glide Wrapper.\\nTo do so please run \\"Configure this application\\"\\nfrom main PlayOnLinux window and select latest option" "Glide wrapper" "$PLAYONLINUX/themes/tango/info.png"
fi

POL_SetupWindow_Close
exit

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com