Forums

Hitman: Codename 47

Script Hitman: Codename 47

Auteur Réponses
massimiliano0790 Lundi 19 September 2011 à 16:46
massimiliano0790Anonymous

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Wine version used : 1.3.4
# Distribution used to test : Mandriva KDE 2011
# Arch version : x32
# Author : Massimiliano0790
# Licence : Retail
  
[ "$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 dmca@playonlinux.com