The forum

Hitman: Codename 47

Script Hitman: Codename 47

Author Replies
massimiliano0790 Monday 19 September 2011 at 16:46
massimiliano0790Anonymous

Hi. I have create script Hitman: Codename 47. Working perfectly.

#!/bin/bash
# Wine version used : 1.3.4
# Distribution used to test : Mandriva KDE 2011
# Arch version : x32
# Author : Massimiliano0790
# Licence : Retail
# Only For : http://www.playonmac.com
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Hitman: Codename 47"
PREFIX="HC47"
WORKING_WINE_VERSION="1.3.4"
 
if [ "$POL_LANG" == "fr" ]; then
LNG_CHOOSE_MEDIA="Quelle version possédez-vous?"
LNG_DVD="Version DVD"
LNG_INSERT_MEDIA="Veuillez insérer le disque $TITLE dans votre lecteur\\nsi ce n'est pas déja fait."
LNG_WAIT_END="Appuyez sur \\"Suivant\\" UNIQUEMENT quand l'installation du\\njeu sera terminée sous peine de devoir recommencer l'installation."
LNG_INSTALL_ON="Installation en cours..."
LNG_GAME_VMS="Quelle est la quantité de mémoire (Mo) de votre carte graphique ?"
LNG_VMS_ERROR="Ce jeu ne fonctionnera correctement qu'avec une carte graphique ayant plus de 128Mo de mémoire."
LNG_SUCCES="$TITLE a été installé avec succès."
else
LNG_CHOOSE_MEDIA="Che versione hai?"
LNG_DVD="DVD"
LNG_INSERT_MEDIA="Prego inserire $TITLE nel lettore\\nse non è pronto."
LNG_WAIT_END="Clicca \\"Avanti\\" SOLO quando l'installazione del gioco è completata\\o ripetere l'installazione."
LNG_INSTALL_ON="Installazione in corso..."
LNG_GAME_VMS="Quanta memoria grafica possiedi?"
LNG_VMS_ERROR="Questo gioco non lavora correttamente con una scheda grafica minore di 128MB di memoria."
LNG_SUCCES="$TITLE è stato installato correttamente."
fi
 
#starting the script
rm "$REPERTOIRE/tmp/*.jpg"
POL_SetupWindow_Init
 
POL_SetupWindow_presentation "$TITLE" "Eidos Interactive" "Massimiliano0790" "$PREFIX" 
 
select_prefix "$POL_USER_ROOT/wineprefix/$PREFIX"
 
# Downloading specific Wine
POL_SetupWindow_install_wine "$WORKING_WINE_VERSION"
Use_WineVersion "$WORKING_WINE_VERSION"
 
# Creating prefix
POL_SetupWindow_prefixcreate
 
# Choose between DVD
POL_SetupWindow_menu "$LNG_CHOOSE_MEDIA" "$TITLE" "$LNG_DVD" "~"
 
if [ "$APP_ANSWER" == "$LNG_DVD" ]; then
GAME_MEDIAVERSION="DVD"
fi
 
# 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_dsound
POL_Call POL_Install_quartz
 
if [ "$GAME_MEDIAVERSION" == "DVD" ]; then
# Asking for CDROM and checking if it's correct one
POL_SetupWindow_message "$LNG_INSERT_MEDIA" "$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Setup.exe"
wine start /unix "$CDROM/Setup.exe"
POL_SetupWindow_message "$LNG_WAIT_END" "$TITLE"
POL_SetupWindow_detect_exit
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 "128" ]; 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" "Hitman.Exe" "$TITLE" ""
Set_WineVersion_Assign "$WORKING_WINE_VERSION" "$TITLE"
 
POL_SetupWindow_message "$LNG_SUCCES" "$TITLE"
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 dmcayonlinux.com