The forum

Impossible to create script for playonlinux

Author Replies
massimiliano0790 Friday 26 August 2011 at 20:53
massimiliano0790Anonymous

Hello. For two days I'm trying to create a script for PlayOnLinux, but without success. Once created, I try to start it but nothing comes out. It is only a problem to you or me does the same thing?

This is mi script

#!/bin/bash
# Wine version used : 1.2.3
# Distribution used to test : Ubuntu 11.04
# Architecture version : x64
# Author : Massimiliano0790
# Licence : Retail
# Only For : http://www.playonmac.com

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

TITLE="RollerCoaster Tycoon 3"
PREFIX="RCT3"
WORKING_WINE_VERSION="1.2.3"

LNG_GAME_VMS="How much memory does your graphics board have?"
LNG_SUCCES="$TITLE has been installed successfully."

# Starting the script
rm "$POL_USER_ROOT/tmp/*.jpg"
POL_SetupWindow_InitWithoutImages

POL_SetupWindow_presentation "$TITLE" "Atari" "http://www.rollercoastertycoon.com" "Massimiliano0790" "$PREFIX"

# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"

# Downloading wine if necessary and creating prefix
POL_System_SetArch "auto"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"

# Choose between DVD
POL_SetupWindow_InstallMethod "DVD"

# Installing mandatory dependencies
POL_Call POL_Install_d3dx10
POL_Call POL_Install_d3dx11
POL_Call POL_Install_d3dx9
POL_Call POL_Install_devenum
POL_Call POL_Install_dinput
POL_Call POL_Install_dinput8
POL_Call POL_Install_directmusic
POL_Call POL_Install_directplay
POL_Call POL_Install_directx9
POL_Call POL_Install_dotnet20
POL_Call POL_Install_dsound
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_quartz
POL_Call POL_Install_wmpcodecs

if [ "$INSTALL_METHOD" == "DVD" ]; then
# Asking for CDROM and checking if it's correct one
POL_SetupWindow_message "$(eval_gettext 'Please insert game media into your disk drive\\nif not already done.')"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "BlackOps.ico"
POL_Wine start /unix "$CDROM/Setup.exe"
POL_SetupWindow_message "$(eval_gettext 'Click on "Forward" ONLY when the game installation is finished\\nor you will have to redo the installation.')" "$TITLE"
fi

# Asking about memory size of graphic card
POL_SetupWindow_menu_list "$LNG_GAME_VMS" "$TITLE" "64-128-256-320-384-512-640-768-896-1024-1536-1792-2048-3072-4096" "-" "256"
VMS="$APP_ANSWER"

cd "$WINEPREFIX/drive_c/windows/temp/"
cat << EOF > vms.reg
[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"VideoMemorySize"="$VMS"
EOF
regedit vms.reg
if [ "$VMS" -lt "256" ]; then
POL_SetupWindow_message "$LNG_VMS_ERROR" "$TITLE"
fi

## Begin GNU/Linux fix ##
# don't work with OSX since 'lspci' command do not exist
if [ "$PLAYONMAC" == "" ]; then
VGA_ID1=`lspci | grep VGA | awk '{ print $1 }' | head -n 1`
VGA_ID2=`lspci -n | grep $VGA_ID1 | awk '{ print $3 }'`
VendorID=`echo $VGA_ID2 | awk -F: '{ print $1 }'`
DeviceID=`echo $VGA_ID2 | awk -F: '{ print $2 }'`
cd "$WINEPREFIX/drive_c/windows/temp/"
if [ "$VendorID" == "10de" ]; then
drvID="nv4_disp.dll"
elif [ "$VendorID" == "1002" ]; then
drvID="ati2dvag.dll"
elif [ "$VendorID" == "8086" ]; then
drvID="ig4icd32.dll"
else
drvID="vga.dll"
fi
cat << EOF > "$POL_USER_ROOT/tmp/VGA_ID_fix.reg"
[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]
"VideoPCIVendorID"="dword:0000$VendorID"
"VideoPCIDeviceID"="dword:0000$DeviceID"
"VideoDriver"="$drvID"
EOF
regedit "$POL_USER_ROOT/tmp/VGA_ID_fix.reg"
fi
## End GNU/Linux fix ##
 
POL_Call POL_Function_OverrideDLL "" "mmdevapi"
 
# Sound problem fix - pulseaudio related
[ "$PLAYONMAC" == "" ] && Set_SoundDriver "alsa"
[ "$PLAYONMAC" == "" ] && Set_SoundEmulDriver "Y"
## End Fix
 
## PlayOnMac Section
[ "$PLAYONMAC" == "" ] || Set_Managed "Off"
## End Section
 
# Cleaning temp
if [ -e "$WINEPREFIX/drive_c/windows/temp/" ]; then
rm -rf "$WINEPREFIX/drive_c/windows/temp/*"
chmod -R 777 "$POL_USER_ROOT/tmp/"
rm -rf "$POL_USER_ROOT/tmp/*"
fi

# Making shortcut
POL_SetupWindow_auto_shortcut "$PREFIX" "RCT3.exe" "$TITLE" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"

POL_SetupWindow_message "$LNG_SUCCES" "$TITLE"
POL_SetupWindow_Close
exit

Edited by massimiliano0790

massimiliano0790 Friday 26 August 2011 at 21:48
massimiliano0790Anonymous

Update: I've got it the problema in the script. The problem is in Starting the script. Sorry for the trouble

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 dmcayonlinux.com