The forum

Battlefield 1942 The Complete Collection

Author Replies
Paul Mallako Saturday 6 March 2010 at 4:47
Paul MallakoAnonymous

Here is my script to install Battlefield 1942 The Complete collection.

This collection contains: Battlefield 1942 and its expansions The Road to Rome and Secret Weapons of WWII, Battlefield Vietnam.

plus Map editor, mod development toolkit, etc....

This script can:
- install the games and its expansions.
- ask for patching BF 1942 to 1.61
- ask for patching BF Vietnam to 1.21
- creates all links to executables

Version of wine : 1.1.23
Distribution : Fedora
Version of the distribution : 10 (Cambridge) - 32bit
Graphics card : GeForce 8600M GT/PCI/SSE2
Driver: from kmod-nvidia package installed with yum

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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/bin/bash
 
#
# This script is based on Planescape Torment script
#
 
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
  
VERSIONWINE=$(wine --version)
TYTUL="Battlefield 1942, The complete collection"
PREFIX="Battlefield1942"
TEMP_DIR="$REPERTOIRE/tmp"
POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "Eletronic Arts" "N/A" "FSM" "$PREFIX"
cfg_check
#
# roda_teste()
# {
#   wine $REPERTOIRE/tmp/pbsetup.exe
#  
# }
 
#procedure for patching BF 1942 and Vietnam
patch_BF()
{
  POL_SetupWindow_menu "What installer should do?" "Actions" "Let me choose patch manually~Download patch automatically" "~"
  if [ "$APP_ANSWER" == "Let me choose patch manually" ]
    then
      POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
      POL_SetupWindow_wait_next_signal "PlayOnLinux is installing patch" "$TYTUL"
      wine "$APP_ANSWER"
      POL_SetupWindow_detect_exit
      POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
  elif [ "$APP_ANSWER" == "Download patch automatically" ]
    then
      POL_SetupWindow_wait_next_signal "PlayOnLinux is downloading $1" "$TYTUL"
      cd "$TEMP_DIR"
      POL_SetupWindow_wait_next_signal "PlayOnLinux is instaling the patch" "$TYTUL"
      wine "$1"
      POL_SetupWindow_detect_exit
      POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
      rm -f $1
  fi
}
 
#asking about patching
POL_SetupWindow_menu "What do you want to do?" "Actions" "install-game patch-BF_1942 patch-BF_Vietnam" " "
if [ "$APP_ANSWER" == "patch-BF_1942" ]; then
  if [ -e "$REPERTOIRE/wineprefix/$PREFIX" ]; then
    patch_BF "battlefield_1942_incremental_patch_v1.6_to_v1.61b.exe"
    POL_SetupWindow_Close
    exit
  else
    POL_SetupWindow_message "The installation was not detected, please verify the path.It should be\\n\\n$REPERTOIRE/wineprefix/$PREFIX" "$TYTUL"
    POL_SetupWindow_Close
    exit
  fi
fi
if [ "$APP_ANSWER" == "patch-BF_Vietnam" ]; then
  if [ -e "$REPERTOIRE/wineprefix/$PREFIX" ]; then
    patch_BF "battlefield_vietnam_incremental_patch_v1.2_to_v1.21.exe"
    POL_SetupWindow_Close
    exit
  else
    POL_SetupWindow_message "The installation was not detected, please verify the path.It should be\\n\\n$REPERTOIRE/wineprefix/$PREFIX" "$TYTUL"
    POL_SetupWindow_Close
    exit
  fi
fi
 
select_prefixe "$REPERTOIRE/wineprefix/$PREFIX"
  
POL_SetupWindow_question "Install Battlefield 1942 and its expasions?\\n\\nObs: Battlefield Vietnam is not a BF 1942 expansion" ""
if [ "$APP_ANSWER" == "TRUE" ]
  then
    FLAG_1942=1
  else
    FLAG_1942=0
fi
 
POL_SetupWindow_question "Install Battlefield Vietnam?" ""
if [ "$APP_ANSWER" == "TRUE" ]
  then
    FLAG_VI=1
  else
    FLAG_VI=0
fi
  
POL_SetupWindow_prefixcreate
FULLPATH="$HOME/.PlayOnLinux/wineprefix/$PREFIX/drive_c/Program Files/EA GAMES"
 
# function which copy disks to ~/.Playonlinux/tmp/disk_?
function copy_disk() {
  POL_SetupWindow_message "Please insert disk $1, mount it and press 'Forward'" "$TYTUL"
  POL_SetupWindow_cdrom
  POL_SetupWindow_wait_next_signal "Copying disk $1" "$TYTUL"
  cd $CDROM
  mkdir -p "$TEMP_DIR/disk_$1"
  cp -fr * "$TEMP_DIR/disk_$1"
  POL_SetupWindow_detect_exit
  umount $CDROM
  eject
}
 
# Copy Cds to ~/.Playonlinux/tmp/disk_?
POL_SetupWindow_message "All needed disks will be copied first to\\n$TEMP_DIR/disk_#" "$TYTUL"
DIR=$(pwd)
 
if [ $FLAG_1942 == 1 ] # if Battlefield 1942 and its expasions are going to be installed
  then
    NUMBER=1
    while [ $NUMBER -le 4 ]
      do
    copy_disk "$NUMBER"
    NUMBER=$(( NUMBER + 1 ));
      done
  fi
if [ $FLAG_VI == 1 ] # if Battlefield Vietnam is going to be installed
  then
    NUMBER=5
    while [ $NUMBER -le 8 ]
      do
    copy_disk "$NUMBER"
        NUMBER=$(( NUMBER + 1 ));
      done
  fi
 
chmod 777 $TEMP_DIR -R
  
#starting installation
 
if [ $FLAG_1942 == 1 ] # if Battlefield 1942 is going to be installed
  then
    POL_SetupWindow_message "Battlefield 1942 is going to be installed now.\\nPlease insert disk labeled 'DISC 1' and mount it." "$TYTUL"
    POL_SetupWindow_wait_next_signal "Installation of Battlefield 1942 in progress...\\n\\nYou don't have to change disks. When asked, just change the path\\n of each disk as below.\\n\\n disk 1: $TEMP_DIR/disk_1\\n disk 2: $TEMP_DIR/disk_2\\n disk 3: $TEMP_DIR/disk_3\\n disk 4: $TEMP_DIR/disk_4\\n" "$TYTUL"
    cd "$TEMP_DIR/disk_1"
    wine "Setup.exe"
    POL_SetupWindow_detect_exit
    cd ..
    # remove directories with BF 1942 discs to avoid Vietnams installer confusion when switchin between discs during install
    cd "$TEMP_DIR"
    rm -rf disk_[1-4]
fi
 
 
     
if [ $FLAG_VI == 1 ] # if Battlefield Vietnam is going to be installed
  then
    POL_SetupWindow_message "Battlefield Vietnam is going to be installed now.\\nPlease insert disk labeled 'DISC 5' and mount it." "$TYTUL"
    POL_SetupWindow_wait_next_signal "Installation of Battlefield 1942 in progress...\\n\\nYou don't have to change disks. When asked, just change the path\\n of each disk as below.\\n\\n disk 1: $TEMP_DIR/disk_5\\n disk 2: $TEMP_DIR/disk_6\\n disk 3: $TEMP_DIR/disk_7\\n disk 4: $TEMP_DIR/disk_8\\n" "$TYTUL"
    cd "$TEMP_DIR/disk_5"
    wine "Setup.exe"
    POL_SetupWindow_detect_exit
    # remove directories with BF Vietnam discs
    cd "$TEMP_DIR"
    rm -rf disk_[5-8]
fi
 
#making shortcut and asking about patching
if [ $FLAG_1942 == 1 ] # if Battlefield Vietnam is going to be installed
  then
    NAME="Battlefield 1942"
    cp "~/.local/share/icons/2948_bf1942.0.png" "$REPERTOIRE/icones/32/$NAME"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield 1942" "BF1942.exe" "" "$NAME" "" "-opengl"
    POL_SetupWindow_question "Do you want to patch Battlefield 1942?" "$TYTUL"
    if [ "$APP_ANSWER" == "TRUE" ] ;then
      patch_BF "battlefield_1942_incremental_patch_v1.6_to_v1.61b.exe"
    fi
     
    # ask if a shortcut to Battlefield 1942 The Road To Rome must be created
    if [ -e "$FULLPATH/Battlefield 1942/Mods/XPack1" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlefield 1942 The Road to Rome?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlefield 1942 The Road to Rome"
    cp "$REPERTOIRE/icones/32/Battlefield 1942" "$REPERTOIRE/icones/32/$NAME"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield 1942" "BF1942.exe" "" "$NAME" "+game XPack1" "-opengl"
      fi
    fi
     
    # ask if a shortcut to Battlefield 1942 Secret Weapons of WWII must be created
    if [ -e "$FULLPATH/Battlefield 1942/Mods/XPack2" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlefield 1942 Secret Weapons of WWII?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlefield 1942 Secret Weapons of WWII"
    cp "$REPERTOIRE/icones/32/Battlefield 1942" "$REPERTOIRE/icones/32/$NAME"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield 1942" "BF1942.exe" "" "$NAME" "+game XPack2" "-opengl"
      fi
    fi
     
    # ask if a shortcut to Battlecraft 1942 must be created
    if [ -e "$FULLPATH/Battlecraft 1942" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlecraft 1942?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlecraft 1942"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlecraft 1942" "bc42.exe" "" "$NAME" "" ""
      fi
    fi
     
    # ask if a shortcut to Battlefield Mod Development Toolkit must be created
    if [ -e "$FULLPATH/Battlefield Mod Development Toolkit" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlefield Mod Development Toolkit?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlefield Mod Development Toolkit"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield Mod Development Toolkit" "BF_Tools.exe" "" "$NAME" "" ""
      fi
    fi
fi
 
if [ $FLAG_VI == 1 ] # if Battlefield Vietnam is going to be installed
  then
    NAME="Battlefield Vietnam"
    cp "$TEMP_DIR/disk_5/BFVietnam.ico" "$REPERTOIRE/icones/32/$NAME"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield Vietnam" "bfvietnam.exe" "" "$NAME" "" ""
    if [ "$APP_ANSWER" == "TRUE" ] ;then
      patch_BF "battlefield_vietnam_incremental_patch_v1.2_to_v1.21.exe"
    fi
     
    # ask if a shortcut to Battlefield Vietnam World War II must be created
    if [ -e "$FULLPATH/Battlefield Vietnam/Mods/BFV_WW2Mod" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlefield Vietnam World War II?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlefield Vietnam World War II"
    cp "$REPERTOIRE/icones/32/Battlefield Vietnam" "$REPERTOIRE/icones/32/$NAME"
        POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield Vietnam" "bfvietnam.exe" "" "$NAME" "" "+game BFV_WW2Mod"
      fi
    fi
     
    # ask if a shortcut to Battlecraft 1942 must be created
    if [ -e "$FULLPATH/Battlecraft Vietnam" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlecraft Vietnam?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlecraft Vietnam"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlecraft Vietnem" "bcv.exe" "" "$NAME" "" ""
      fi
    fi
     
    # ask if a shortcut to Battlefield Mod Development Toolkit must be created
    if [ -e "$FULLPATH/Battlefield Mod Development Toolkit" ]; then
      POL_SetupWindow_question "Do you want to create a shortcut to Battlefield Mod Development Toolkit?" "$TYTUL"
      if [ "$APP_ANSWER" == "TRUE" ] ;then
    NAME="Battlefield Mod Development Toolkit"
    POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/EA GAMES/Battlefield Mod Development Toolkit" "BF_Tools.exe" "" "$NAME" "" ""
      fi
    fi
fi
  
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
  
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