#!/bin/bash
[ -z
"$PLAYONLINUX"
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
PREFIX=
"MotoRacer_gog"
WORKING_WINE_VERSION=
"1.3.23"
INSTALLBIN=
"setup_moto_racer.exe"
TITLE=
"Moto Racer (GoG release)"
SHORTCUT_NAME=
"Moto Racer"
POL_SetupWindow_Init
POL_Debug_Init
POL_RequiredVersion
"4.0.15"
POL_SetupWindow_presentation
"$TITLE"
"Delphine Software / Anuman Interactive"
"$URL"
"Pierre Etchemaite"
"$PREFIX"
POL_SetupWindow_question
"$(eval_gettext 'Do you want to download $TITLE from GOG.com?')"
"$TITLE"
[
"$APP_ANSWER"
=
"TRUE"
] && POL_Browser
"$URL"
POL_Wine_SelectPrefix
"$PREFIX"
POL_Wine_PrefixCreate
"$WORKING_WINE_VERSION"
cd
$HOME
POL_SetupWindow_browse
"$(eval_gettext 'Please select the setup file to run.')"
"$TITLE"
"$INSTALLBIN"
ARCHIVE=
"$APP_ANSWER"
POL_SetupWindow_wait
"$(eval_gettext 'Please wait while $TITLE is installed.')"
"$TITLE"
POL_Call
POL_Function_SetNativeExtension
"pdf"
POL_Wine
start
/unix
"$ARCHIVE"
|| POL_Debug_Fatal
"$(eval_gettext 'Error while installing archive')"
POL_Wine_WaitExit
"$TITLE"
Set_OS winxp
POL_SetupWindow_VMS
"2"
ln
-sf /
"$WINEPREFIX/dosdevices/d:"
cat
<<_EOFINI_ >
"$POL_USER_ROOT/tmp/cdrom.reg"
REGEDIT4
[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]
"D:"
=
"cdrom"
_EOFINI_
POL_Wine
regedit.exe
"$POL_USER_ROOT/tmp/cdrom.reg"
rm
"$POL_USER_ROOT/tmp/cdrom.reg"
POL_Wine_reboot
POL_Shortcut
"MotoRacer.exe"
"$SHORTCUT_NAME"
POL_Shortcut_Document
"$SHORTCUT_NAME"
"$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Moto Racer/faq_uk.txt"
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
'TITLE="'
"$TITLE
"'"
'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
'POL_Debug_Init'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
'[ -z "$PLAYONMAC" ] && BPP="$(xdpyinfo|sed '
"
'"'
s/^ *depth of root window: *\\([0-9]\\+\\).*$/\\1
/p
; d
'"'
"')"
|| BPP=16'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
'if [ $BPP != 16 ]; then'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' [ -z "$(command -v Xephyr)" ] && POL_Debug_Fatal "$(eval_gettext '
"
'"'
This game requires a 16bpp display (65536 colors)\\nIf you dont want to change your display setup each
time
,\\nyou can
install
Xephyr to emulate a 16bpp X server.
'"'
"')"
'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' POL_Debug_Message "Using Xephyr to emulate 16bit display"'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' Xephyr :1 -screen 640x480x16 &'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' XEPHYR_PID=$!'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' sleep 1'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' DISPLAY=:1'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' trap '
"'"
'
kill
$XEPHYR_PID
'"'
"
' EXIT'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' cp motoracer.ini motoracer.bak'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
' sed "s/^D3D=true/D3D=false/" motoracer.bak > motoracer.ini'
POL_Shortcut_InsertBeforeWine
"$SHORTCUT_NAME"
'fi'
POL_SetupWindow_message
"$(eval_gettext 'MotoRacer needs a 16bpp (65536 colors) display to run.\\nUnder Linux, this script can make use of Xephyr\\nto make it run without modifying your screen configuration.\\n\\nOn first run, if you experience no sound in game go to\\nthe Options menu and increase volume.')"
"$TITLE"
POL_SetupWindow_Close
exit