The forum

[Script] Rise of Nations

Author Replies
warcry Friday 11 September 2009 at 0:43
warcryAnonymous

I have made this script for install Rise of Nations (without expansion). I will publish the expansion script soon.
I post here to ask you if it works, if it's written OK, etc.

 

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
#!/bin/bash
# Date: (2009-08-10 23-55)
# Last revision: (2009-08-10 23-55)
# Wine version used: 1.1.29
# Licence: GPLv3
# Tested with standard Rise of Nations, not Gold Edition
 
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
 
source "$PLAYONLINUX/lib/sources"
 
TYTUL="Rise of Nations"
 
mkdir -p $REPERTOIRE/tmp/RON
cd $REPERTOIRE/tmp/RON
 
POL_SetupWindow_Init "$REPERTOIRE/tmp/RON/topzp.jpg" "$REPERTOIRE/tmp/RON/leftz.jpg"
 
if [ "$POL_LANG" == "es" ]; then
LNG_CABEXTRACT="Se necesita cabextract para extraer los cabinets de DirectX.\\n\\nPuedes instalarlo desde los repositorios de tu distro utilizando una herramienta como synaptic o apt-get. El paquete se llama \\"cabextract\\".\\nSin él no puedo continuar con la instalación."
LNG_MISSINGCOMPONENTS="Faltan componentes"
LNG_LOADINGSETUP="Cargando instalación"
LNG_INSTALLING="El instalador de Rise of Nations se está ejecutando.\\n\\nHaz una instalación normal. No instales GameSpy Arcade ni hagas click en \\"Jugar ahora\\".\\nCuando la instalación termine, haz clic en Siguiente.\\n\\nSi después de un tiempo el instalador todavía no ha aparecido, cancela y vuelve a\\nejecutar este script. Asegúrate de elegir bien el medio de instalación."
LNG_RUNNINGSETUP="Ejecutando instalación"
LNG_DOWNLOADINGUPDATE="Descargando actualización de Rise of Nations (es necesaria)"
LNG_SCREENSIZE="¿Qué tamaño de pantalla usarás para jugar al juego? (si no sabes, clic en Siguiente)"
LNG_DXLIBS="Instalando algunas bibliotecas de DirectX para el sonido"
LNG_INSTALLINGUPDATE="Instalando actualización"
LNG_INSTALLED="Rise of Nations ha sido instalado correctamente"
else
LNG_CABEXTRACT="cabextract is needed to extract the DirectX cabinets.\\n\\nYou can install them with the package tool of your Linux distribution (like Synaptic). The package name is \\"cabextract\\".\\nWithout cabextract I can't continue with the installation."
LNG_MISSINGCOMPONENTS="Missing components"
LNG_LOADINGSETUP="Loading Setup"
LNG_INSTALLING="The Rise of Nations Autorun is running.\\n\\nMake standard installation. Don't install GameSpy Arcade. Don't click to play now.\\nWhen the setup has been finished, click Next\\n\\nIf passed a while the installer hasn't appeared click \\"Cancel\\" and try again.\\nMake sure of choosing correct CD."
LNG_RUNNINGSETUP="Running Setup"
LNG_DOWNLOADINGUPDATE="Downloading update for Rise of Nations (required to be playable)"
LNG_SCREENSIZE="What screen size would you like to playing the game (if you don't known, click Next)"
LNG_DXLIBS="Installing DirectX libs required for sound"
LNG_INSTALLINGUPDATE="Installing update"
LNG_INSTALLED="Rise of Nations is installed"
fi
 
POL_SetupWindow_presentation "Rise of Nations" "Big Huge" "www.microsoft.com/Games/riseofnations/" "warcry" "Rise_of_Nations"
 
#cabextract is needed to extract DirectX archives
check_one "cabextract" "cabextract"
 
if [ "$MANQUE" == "true" ]
then
POL_SetupWindow_message "$LNG_CABEXTRACT" "$LNG_MISSINGCOMPONENTS"
POL_SetupẀindow_Close
exit
fi
 
POL_SetupWindow_cdrom
INSTALLER=$(Read_autorun)
 
select_prefix "$HOME/.PlayOnLinux/wineprefix/Rise_of_Nations/"
POL_SetupWindow_prefixcreate
PREFIX="$HOME/.PlayOnLinux/wineprefix/Rise_of_Nations"
 
#start installation
 
POL_SetupWindow_wait_next_signal "$LNG_LOADINGSETUP" "Rise of Nations"
#Fetch PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
#Fetching APPDATA environmental variable
APPDATA=`wine cmd /c echo "%AppData%"`
APPDATA=${APPDATA:3}
echo $APPDATA | sed 's/\\\\/\\//g' > $REPERTOIRE/tmp/RON/appdata #this change \\ with /
APPDATA=`cat $REPERTOIRE/tmp/RON/appdata`
echo "$PREFIX/drive_c/$APPDATA/Microsoft Games/Rise of Nations"
wine $INSTALLER
POL_SetupWindow_detect_exit
POL_SetupWindow_message "$LNG_INSTALLING" "$LNG_RUNNINGSETUP"
 
#Download update for Rise of Nations, needed to solve the click bug http://bugs.winehq.org/show_bug.cgi?id=17614
 
mkdir $REPERTOIRE/downloads
cd $REPERTOIRE/downloads
if [ "`sha1sum ronpatch.exe`" != "728bb284f2ba335dcfdae6bd889facdeca100662 ronpatch.exe" ]
then
POL_SetupWindow_download "$LNG_DOWNLOADINGUPDATE" "Rise of Nations update" "http://download.microsoft.com/download/b/9/5/b95728f8-9727-43cd-834f-a11d019cae9f/ronpatch.exe"
fi
 
#Working in window works better
XRANDR=`xrandr --current | grep current`
SCREEN_SIZE=`echo $XRANDR | cut -d , -f 2 | cut -d \\ -f 3`x`echo $XRANDR | cut -d , -f 2 | cut -d \\ -f 5`
POL_SetupWindow_textbox "$LNG_SCREENSIZE" "Rise of Nations" "$SCREEN_SIZE"
 
W_WIDTH=`echo $APP_ANSWER | cut -d x -f 1`
W_HEIGHT=`echo $APP_ANSWER | cut -d x -f 2`
Set_Desktop On $W_WIDTH $W_HEIGHT
 
#There are to set some settings in rise2.ini to get the game work properly (click bug)
mkdir -p "$PREFIX/drive_c/$APPDATA/Microsoft Games/Rise of Nations"
cd "$PREFIX/drive_c/$APPDATA/Microsoft Games/Rise of Nations"
#this file is naturally created after the patch
echo "[RISE OF NATIONS]
 
Windowed Width=$W_WIDTH
 
Windowed Height=$W_HEIGHT
 
FullScreen=1
 
VSync=1
 
AllowAllResolutions=0
 
IgnoreMinimizeOnTabOut=0
 
ConfigDatabase=BHGVidCardConfig.txt
 
ESCKeyGoesToMenu=1
 
ClickDragTiming=5
 
ClickDragLowSensitive=20
 
ClickDragHighSensitive=64
 
ClickDragRightSensitive=6
 
SkipIntroMovies=0
 
ForceHardwareCursor=0
 
ForceGDICursor=0
 
ForceBWCursor=0
 
ForceStaticCursor=0
 
ForceAGPVBs=0
 
Don't Allow Texture Compression=0
 
SYS_grade_override(A-F or AUTO)=AUTO
 
MEM_grade_override(A-F or AUTO)=AUTO
 
CPU_grade_override(A-F or AUTO)=AUTO
 
GPU_grade_override(A-F or AUTO)=AUTO
 
TEXTURE_grade_override(FULL, HALF, QUARTER, AUTO)=AUTO
 
UseAltColors=0
 
Console Coord Mode=0
 
Console Name Mode=2
 
Sound Enabled=1
 
BackVidAsSlideShow=0
 
UseVTUNEDLL=0
 
TestDelayRenderAMin=0
 
TestDelayRenderBMin=0
 
TestDelayRenderAMax=0
 
TestDelayRenderBMax=0
 
Force Profile Menu=0
 
ForceLowCPUBackgroundVid=1
" > rise2.ini
 
#Some native DirectX libs are required for sound
POL_SetupWindow_wait_next_signal "$LNG_DXLIBS" "Rise of Nations"
mkdir -p $REPERTOIRE/tmp/RON/dxcab_tmp/
cd $REPERTOIRE/tmp/RON/dxcab_tmp/
cabextract $CDROM/DIRECTX/DXNT.CAB
cp dsound.dll $PREFIX/drive_c/windows/system32/
cp dmime.dll $PREFIX/drive_c/windows/system32/
cp dmsynth.dll $PREFIX/drive_c/windows/system32/
cp dmusic.dll $PREFIX/drive_c/windows/system32/
cp dswave.dll $PREFIX/drive_c/windows/system32/
cp dmloader.dll $PREFIX/drive_c/windows/system32/ #this and following are for intro videos
cp quartz.dll $PREFIX/drive_c/windows/system32/
cp devenum.dll $PREFIX/drive_c/windows/system32/
 
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DllOverrides]" > $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dsound\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dmime\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dmsynth\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dmusic\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dswave\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"dmloader\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"quartz\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"devenum\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"l3codecx\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "" >> $REPERTOIRE/tmp/RON/dx.reg
#this is more personal, I don't like the blue-Windows background color every time the game is loading
echo "[HKEY_CURRENT_USER\\\\Control Panel\\\\Colors]" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"Background\\"=\\"0 0 0\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"ButtonFace\\"=\\"192 192 192\\"" >> $REPERTOIRE/tmp/RON/dx.reg
regedit $REPERTOIRE/tmp/RON/dx.reg
 
POL_SetupWindow_detect_exit
 
#Installing the patch should be the last
POL_SetupWindow_wait_next_signal "$LNG_INSTALLINGUPDATE" "Rise of Nations"
wine $REPERTOIRE/downloads/ronpatch.exe
POL_SetupWindow_detect_exit
 
#Create a launcher and delete temporary files
POL_SetupWindow_make_shortcut "Rise_of_Nations" "$PROGRAMFILES/Microsoft Games/Rise of Nations" "rise.exe" "" "Rise of Nations" ""
 
#Clean temp
rm -R $REPERTOIRE/tmp/RON
clean_tmp
 
POL_SetupWindow_message "$LNG_INSTALLED"
 
POL_SetupWindow_Close
exit

Edited by Dadu042

NSLW Friday 11 September 2009 at 8:26
NSLW

1
2
3
if [ "$PLAYONLINUX" = "" ]then
exit 0
fi
This is wrong

1
TYTUL="Rise of Nations"
you musn't use TYTUL, it is only Title in Polish language

1
2
#cabextract is needed to extract DirectX archives
check_one "cabextract" "cabextract"
You don't need this as cabextract i POL's dependency

1
select_prefix "$HOME/.PlayOnLinux/wineprefix/Rise_of_Nations/"
This should be written otherwise

1
echo "\\"dsound\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg

you can do
1
2
cd "$REPERTOIRE/tmp/RON"
echo "\\"dsound\\"=\\"native,builtin\\"" >> dx.reg


1
2
3
4
5
#this is more personal, I don't like the blue-Windows background color every time the game is loading
echo "[HKEY_CURRENT_USER\\\\Control Panel\\\\Colors]" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"Background\\"=\\"0 0 0\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"ButtonFace\\"=\\"192 192 192\\"" >> $REPERTOIRE/tmp/RON/dx.reg
regedit $REPERTOIRE/tmp/RON/dx.reg
Is this required to run the game?
warcry Friday 11 September 2009 at 13:41
warcryAnonymous

1
2
3
if [ "$PLAYONLINUX" = "" ]then
exit 0
fi
This is wrong
[/qoute]
really? http://www.playonmac.com/en/dev-documentation-1.html
Perhaps "then" should be in new line, in my script it's in new line, I don't know why it's in the same when I posted here. =S
[quote from=NSLW]
1
TYTUL="Rise of Nations"
you musn't use TYTUL, it is only Title in Polish language

Quote from NSLW

fixed, I got confused


1
2
#cabextract is needed to extract DirectX archives
check_one "cabextract" "cabextract"
You don't need this as cabextract i POL's dependency

Quote from NSLW

fixed


1
select_prefix "$HOME/.PlayOnLinux/wineprefix/Rise_of_Nations/"
This should be written otherwise

Quote from NSLW

I don't understand. I see it in documentation. http://www.playonmac.com/en/dev-documentation-5.html


1
echo "\\"dsound\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg

you can do
1
2
cd "$REPERTOIRE/tmp/RON"
echo "\\"dsound\\"=\\"native,builtin\\"" >> dx.reg

Quote from NSLW

fixed


1
2
3
4
5
#this is more personal, I don't like the blue-Windows background color every time the game is loading
echo "[HKEY_CURRENT_USER\\\\Control Panel\\\\Colors]" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"Background\\"=\\"0 0 0\\"" >> $REPERTOIRE/tmp/RON/dx.reg
echo "\\"ButtonFace\\"=\\"192 192 192\\"" >> $REPERTOIRE/tmp/RON/dx.reg
regedit $REPERTOIRE/tmp/RON/dx.reg
Is this required to run the game?

Quote from NSLW

Not, It's to not see the blue screen while loading the game

Edited by warcry

warcry Friday 11 September 2009 at 13:55
warcryAnonymous

oops, i forgot to post the fixed version:
http://pastebin.com/f7442cdf1
http://pastebin.com/m4f3f3179

Edited by warcry

NSLW Friday 11 September 2009 at 13:59
NSLW

1
2
really? http://www.playonmac.com/en/dev-documentation-1.html
Perhaps "then" should be in new line, in my script it's in new line, I don't know why it's in the same when I posted here. =S

No, just do short
1
2
[ "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"

I don't understand. I see it in documentation. http://www.playonmac.com/en/dev-documentation-5.html

Quote

I think this must be clarified but for know it's better to use POL's REPERTOIRE so it would look like
1
select_prefix "$REPERTOIRE/wineprefix/Rise_of_Nations/"



1
echo "\\"dsound\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg

you can do
1
2
cd "$REPERTOIRE/tmp/RON"
echo "\\"dsound\\"=\\"native,builtin\\"" >> dx.reg

Quote from warcry

fixed

Quote from NSLW


No you didn't fix that
warcry Friday 11 September 2009 at 14:04
warcryAnonymous

Now is it fixed? http://pastebin.com/m4165482




1
echo "\\"dsound\\"=\\"native,builtin\\"" >> $REPERTOIRE/tmp/RON/dx.reg

you can do
1
2
cd "$REPERTOIRE/tmp/RON"
echo "\\"dsound\\"=\\"native,builtin\\"" >> dx.reg

Quote from NSLW

fixed

Quote from warcry


No you didn't fix that

Quote from NSLW

why not?
NSLW Friday 11 September 2009 at 18:38
NSLW

Yes, now it's fixed.
1)Here is one more thing that i don't like
1
mkdir $REPERTOIRE/downloads
for such things there is $REPERTOIRE/ressources directory so no need to create another

2)In heading of script there is also no
# Distribution used to test:
# Author:

3) you don't need this
1
PREFIX="$HOME/.PlayOnLinux/wineprefix/Rise_of_Nations"
just use WINEPREFIX variable

4)You could also take all the paths in quotes like e.g this
1
cd $REPERTOIRE/tmp/RON/dxcab_tmp/
could look like this
1
cd "$REPERTOIRE/tmp/RON/dxcab_tmp/"
Second case is better because when space occur in name then in first case command won't work as it should

Edited by NSLW

warcry Sunday 13 September 2009 at 14:03
warcryAnonymous

1) I didn't known. fixed!
2) Really matters the distribution? Wine is the same for all, but fixed
3) ok, fixed
4) fixed in most, I think.

http://pastebin.com/m6f6d501
Ignore the blank lines you see... PasteBin hates me.
warcry Sunday 13 September 2009 at 14:32
warcryAnonymous

damn invisible characters and damn DOS format!
re-fixed script:
http://pastebin.com/m3106c298
warcry Sunday 13 September 2009 at 15:12
warcryAnonymous

Now my script doesn't work :cry:

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