The forum

[script] AgeOfEmpires III Add-ons

Author Replies
NSLW Wednesday 2 December 2009 at 16:17
NSLW

Hello,
I wrote script which installs add-ons for AgeOfEmpires III. Game can be patched after installation.
Wine version : 1.1.33
Distribution : Fedora
Distribution Version : 12 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 195.22

AgeOfEmpires III - The WarChiefs
Icon for the game:


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
#!/bin/bash
# Date : (2009-12-02 15-30)
# Last revision : (2009-12-02 15-30)
# Wine version used : 1.1.33
# Distribution used to test : Fedora 12
# Author : NSLW
# Licence : Retail
# Depend : -
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TYTUL="Age of Empires III - The WarChiefs"
PREFIX="AOE3"
PATCHVERSION="105"
  
#procedure for patching Age of Empires III
patch_aoe3()
{
POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
wine $APP_ANSWER
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
 
Get_Latest_Wine_Version()
{
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document="$REPERTOIRE/tmp/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
 
POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}
 
wget http://upload.wikimedia.org/wikipedia/en/8/83/AgeIIITheWarChiefs.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
 
POL_SetupWindow_presentation "$TYTUL" "Ensemble Studios" "www.ageofempires3.com" "NSLW" "$PREFIX"
  
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
#asking about patching or updating Wine version
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
 
if [ "$APP_ANSWER" == "Patch game" ]; then
    patch_aoe3
fi
 
POL_SetupWindow_Close
exit
fi
 
cd "$REPERTOIRE/ressources/"
#determining which Version is the latest
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
 
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
Use_WineVersion "$CHOSENWINEVERSION"
 
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Age of Empires III - The WarChiefs.msi"
 
#starting installation
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd "$CDROM"
CHECK=$(find . -iwholename ./setup.exe)
 
if [ "$CHECK" == "" ]; then
wine "instalar.exe"
else
wine "setup.exe"
fi
 
POL_SetupWindow_detect_exit
 
cd "$WINEPREFIX/drive_c/windows/temp/"
 
#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Games/Age of Empires III" "age3x.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "*_age3x.0.png"
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
 
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
 
killall IDriver.exe
killall setup.exe
 
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ]; then
 
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
patch_aoe3
elif [ "$APP_ANSWER" == "Download patch automatically" ]
    then
    POL_SetupWindow_menu "What is your language version?" "Languages" "english~french~italian~german~spanish~brazilian~polish~japanese~korean~chinese~czech~hungarian~russian" "~"
    LANGUAGEVERSION=$APP_ANSWER
    if [ "$APP_ANSWER" == "english" ]; then
    LANGUAGEVERSIONSHRT="EN"
    elif [ "$APP_ANSWER" == "french" ]
    then
    LANGUAGEVERSIONSHRT="FR"
    elif [ "$APP_ANSWER" == "italian" ]
    then
    LANGUAGEVERSIONSHRT="IT"
    elif [ "$APP_ANSWER" == "german" ]
    then
    LANGUAGEVERSIONSHRT="DE"
    elif [ "$APP_ANSWER" == "spanish" ]
    then
    LANGUAGEVERSIONSHRT="ES"
    elif [ "$APP_ANSWER" == "brazilian" ]
    then
    LANGUAGEVERSIONSHRT="BP"
    elif [ "$APP_ANSWER" == "polish" ]
    then
    LANGUAGEVERSIONSHRT="PL"
    elif [ "$APP_ANSWER" == "japanese" ]
    then
    LANGUAGEVERSIONSHRT="JP"
    elif [ "$APP_ANSWER" == "korean" ]
    then
    LANGUAGEVERSIONSHRT="KOR"
    elif [ "$APP_ANSWER" == "chinese" ]
    then
    LANGUAGEVERSIONSHRT="CHT"
    elif [ "$APP_ANSWER" == "czech" ]
    then
    LANGUAGEVERSIONSHRT="CZE"
    elif [ "$APP_ANSWER" == "hungarian" ]
    then
    LANGUAGEVERSIONSHRT="HU"
    elif [ "$APP_ANSWER" == "russian" ]
    then
    LANGUAGEVERSIONSHRT="RU"
    fi
 
    cd "$REPERTOIRE/ressources"
    #downloading patch
    if [ ! -e "aoe3x-$PATCHVERSION-${LANGUAGEVERSION}.exe" ]; then
    POL_SetupWindow_download "PlayOnLinux is downloading aoe3-$PATCHVERSION-${LANGUAGEVERSION}.exe" "Downloading patch" "http://aom.zone.com/MGS/ES/loc/patchx$PATCHVERSION/$LANGUAGEVERSIONSHRT/aoe3x-$PATCHVERSION-${LANGUAGEVERSION}.exe"
    fi
    POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
    wine "aoe3x-$PATCHVERSION-${LANGUAGEVERSION}.exe"
    POL_SetupWindow_detect_exit
    POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
fi
 
fi
 
POL_SetupWindow_message_image "Enable V-Sync in game\\notherwise you won't be able to run game second time\\n(tip by Oisin O Malley)" "Note about V-sync" "$PLAYONLINUX/themes/tango/warning.png"
 
POL_SetupWindow_message_image "Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"
 
POL_SetupWindow_Close
exit


Age of Empires III - The Asian Dynasties

Icon for the game:


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
#!/bin/bash
# Date : (2009-12-02 15-30)
# Last revision : (2009-12-02 15-30)
# Wine version used : 1.1.33
# Distribution used to test : Fedora 12
# Author : NSLW
# Licence : Retail
# Depend : -
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TYTUL="Age of Empires III - The Asian Dynasties"
PREFIX="AOE3"
PATCHVERSION="102"
  
#procedure for patching Age of Empires III
patch_aoe3()
{
POL_SetupWindow_browse "Select patch file" "$TYTUL" ""
wine $APP_ANSWER
POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
}
 
Get_Latest_Wine_Version()
{
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document="$REPERTOIRE/tmp/LIST"
xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\\.//g' | cut -d';' -f2 | sort -n | tail -n1`
echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
 
POL_SetupWindow_make_icon_for_shortcut()
{
convert "$HOME/.local/share/icons/$2" -geometry 32X32 "$REPERTOIRE/icones/32/$1"
}
 
wget http://upload.wikimedia.org/wikipedia/en/c/c7/Tad_box.jpg --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
 
POL_SetupWindow_presentation "$TYTUL" "Ensemble Studios" "www.ageofempires3.com" "NSLW" "$PREFIX"
  
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
 
#asking about patching or updating Wine version
if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
 
if [ "$APP_ANSWER" == "Patch game" ]; then
    patch_aoe3
fi
 
POL_SetupWindow_Close
exit
fi
 
cd "$REPERTOIRE/ressources/"
#determining which Version is the latest
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION="$LATESTVERSION"
 
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
Use_WineVersion "$CHOSENWINEVERSION"
 
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
 
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "Age of Empires III - The Asian Dynasties.msi"
 
#starting installation
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd "$CDROM"
CHECK=$(find . -iwholename ./setup.exe)
 
if [ "$CHECK" == "" ]; then
wine "instalar.exe"
else
wine "setup.exe"
fi
 
POL_SetupWindow_detect_exit
 
cd "$WINEPREFIX/drive_c/windows/temp/"
 
#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Games/Age of Empires III" "age3y.exe" "" "$TYTUL" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL"
POL_SetupWindow_make_icon_for_shortcut "$TYTUL" "*_age3y.0.png"
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
 
POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
 
killall IDriver.exe
killall setup.exe
 
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ]; then
 
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
patch_aoe3
elif [ "$APP_ANSWER" == "Download patch automatically" ]
    then
    POL_SetupWindow_menu "What is your language version?" "Languages" "english~french~italian~german~spanish~brazilian~polish~japanese~korean~chinese~czech~hungarian~russian" "~"
    LANGUAGEVERSION=$APP_ANSWER
    if [ "$APP_ANSWER" == "english" ]; then
    LANGUAGEVERSIONSHRT="EN"
    elif [ "$APP_ANSWER" == "french" ]
    then
    LANGUAGEVERSIONSHRT="FR"
    elif [ "$APP_ANSWER" == "italian" ]
    then
    LANGUAGEVERSIONSHRT="IT"
    elif [ "$APP_ANSWER" == "german" ]
    then
    LANGUAGEVERSIONSHRT="DE"
    elif [ "$APP_ANSWER" == "spanish" ]
    then
    LANGUAGEVERSIONSHRT="ES"
    elif [ "$APP_ANSWER" == "brazilian" ]
    then
    LANGUAGEVERSIONSHRT="BP"
    elif [ "$APP_ANSWER" == "polish" ]
    then
    LANGUAGEVERSIONSHRT="PL"
    elif [ "$APP_ANSWER" == "japanese" ]
    then
    LANGUAGEVERSIONSHRT="JP"
    elif [ "$APP_ANSWER" == "korean" ]
    then
    LANGUAGEVERSIONSHRT="KOR"
    elif [ "$APP_ANSWER" == "chinese" ]
    then
    LANGUAGEVERSIONSHRT="CHT"
    elif [ "$APP_ANSWER" == "czech" ]
    then
    LANGUAGEVERSIONSHRT="CZE"
    elif [ "$APP_ANSWER" == "hungarian" ]
    then
    LANGUAGEVERSIONSHRT="HU"
    elif [ "$APP_ANSWER" == "russian" ]
    then
    LANGUAGEVERSIONSHRT="RU"
    fi
 
    cd "$REPERTOIRE/ressources"
    #downloading patch
    if [ ! -e "aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe" ]; then
    POL_SetupWindow_download "PlayOnLinux is downloading aoe3-$PATCHVERSION-${LANGUAGEVERSION}.exe" "Downloading patch" "http://aom.zone.com/MGS/ES/loc/patchy$PATCHVERSION/$LANGUAGEVERSIONSHRT/aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe"
    fi
    POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
    wine "aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe"
    POL_SetupWindow_detect_exit
    POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
fi
 
fi
 
POL_SetupWindow_message_image "Enable V-Sync in game\\notherwise you won't be able to run game second time\\n(tip by Oisin O Malley)" "Note about V-sync" "$PLAYONLINUX/themes/tango/warning.png"
 
POL_SetupWindow_message_image "Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"
 
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