2
2
; General Attributes
3
3
4
4
!define APNAME Mega-Glest
5
+ !define APVER 3.3 .4
5
6
6
- Name " ${APNAME} 3.3.3 "
7
+ Name " ${APNAME} ${APVER} "
7
8
SetCompressor /FINAL /SOLID lzma
8
9
SetCompressorDictSize 64
9
- OutFile " ${APNAME}-Installer.exe"
10
+ OutFile " ${APNAME}-Installer-${APVER}_i386_win32 .exe"
10
11
Icon " ..\glest.ico"
11
12
UninstallIcon " ..\glest.ico"
12
13
!define MUI_ICON " ..\glest.ico"
13
14
!define MUI_UNICON " ..\glest.ico"
14
- InstallDir " $PROGRAMFILES\${APNAME}"
15
+ InstallDir " $PROGRAMFILES\${APNAME}_${APVER} "
15
16
ShowInstDetails show
16
17
BGGradient 0xDF9437 0xffffff
17
18
18
19
; Request application privileges for Windows Vista
19
20
RequestExecutionLevel none
20
21
22
+ PageEx license
23
+ LicenseText " Megaglest License"
24
+ LicenseData " ..\..\..\data\glest_game\docs\license.txt"
25
+ PageExEnd
26
+
27
+ PageEx license
28
+ LicenseText " Megaglest README"
29
+ LicenseData " ..\..\..\data\glest_game\docs\readme.txt"
30
+ PageExEnd
31
+
21
32
; --------------------------------
22
33
; Images not included!
23
34
; Use your own animated GIFs please
@@ -35,7 +46,7 @@ RequestExecutionLevel none
35
46
36
47
; Registry key to check for directory (so if you install again, it will
37
48
; overwrite the old one automatically)
38
- InstallDirRegKey HKLM " Software\${APNAME}" " Install_Dir"
49
+ InstallDirRegKey HKLM " Software\${APNAME}_${APVER} " " Install_Dir"
39
50
40
51
; Pages
41
52
@@ -57,14 +68,18 @@ Function MUIGUIInit
57
68
# GetDlgItem $0 $0 1006
58
69
# SetCtlColors $0 0xDF9437 0xDF9437
59
70
60
- ReadRegStr $R0 HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}" " UninstallString"
71
+ ReadRegStr $R0 HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} " " UninstallString"
61
72
StrCmp $R0 " " doneInit
62
73
63
74
MessageBox MB_OKCANCEL |MB_ICONEXCLAMATION \
64
- " ${APNAME} is already installed. $\n$\n Click `OK` to remove the \
65
- previous version or `Cancel` to cancel this upgrade ." \
75
+ " ${APNAME} v${APVER} is already installed. $\n$\n Click `OK` to remove the \
76
+ previous installation or `Cancel` to install to a different location ." \
66
77
IDOK uninstInit
67
- Abort
78
+
79
+ # change install folder to a version specific name to aovid over-writing
80
+ # old one
81
+ StrCpy $INSTDIR " $PROGRAMFILES\${APNAME}_${APVER}"
82
+ goto doneInit
68
83
69
84
; Run the uninstaller
70
85
uninstInit:
@@ -86,7 +101,7 @@ FunctionEnd
86
101
87
102
Function .onInstSuccess
88
103
89
- MessageBox MB_OK " ${APNAME} installed successfully, click OK to launch game."
104
+ MessageBox MB_OK " ${APNAME} v${APVER} installed successfully, click OK to launch game."
90
105
91
106
SetOutPath $INSTDIR
92
107
Exec ' glest_game.exe'
@@ -124,13 +139,13 @@ Section "${APNAME} (required)"
124
139
# File /r /x .svn "..\..\..\data\glest_game\screens"
125
140
126
141
; Write the installation path into the registry
127
- WriteRegStr HKLM Software\${APNAME} " Install_Dir" " $INSTDIR"
142
+ WriteRegStr HKLM Software\${APNAME} _ ${APVER} " Install_Dir" " $INSTDIR"
128
143
129
144
; Write the uninstall keys for Windows
130
- WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}" " DisplayName" " ${APNAME}"
131
- WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}" " UninstallString" ' "$INSTDIR\uninstall.exe"'
132
- WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}" " NoModify" 1
133
- WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}" " NoRepair" 1
145
+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} " " DisplayName" " ${APNAME} v${APVER }"
146
+ WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} " " UninstallString" ' "$INSTDIR\uninstall.exe"'
147
+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} " " NoModify" 1
148
+ WriteRegDWORD HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} " " NoRepair" 1
134
149
WriteUninstaller " uninstall.exe"
135
150
136
151
CreateDirectory $INSTDIR \data
@@ -149,13 +164,13 @@ SectionEnd
149
164
; Optional section (can be disabled by the user)
150
165
Section " Start Menu Shortcuts"
151
166
152
- CreateDirectory " $SMPROGRAMS\${APNAME}"
153
- CreateShortCut " $SMPROGRAMS\${APNAME}\Uninstall.lnk" " $INSTDIR\uninstall.exe" " " " $INSTDIR\uninstall.exe" 0
154
- CreateShortCut " $SMPROGRAMS\${APNAME}\${APNAME}_game.lnk" " $INSTDIR\glest_game.exe" " " " $INSTDIR\glest_game.exe" 0
167
+ CreateDirectory " $SMPROGRAMS\${APNAME}_${APVER} "
168
+ CreateShortCut " $SMPROGRAMS\${APNAME}_${APVER} \Uninstall.lnk" " $INSTDIR\uninstall.exe" " " " $INSTDIR\uninstall.exe" 0
169
+ CreateShortCut " $SMPROGRAMS\${APNAME}_${APVER} \${APNAME}_${APVER }_game.lnk" " $INSTDIR\glest_game.exe" " " " $INSTDIR\glest_game.exe" 0
155
170
156
- CreateShortCut " $SMPROGRAMS\${APNAME}\${APNAME}_config.lnk" " $INSTDIR\glest_configurator.exe" " " " $INSTDIR\glest_configurator.exe" 0
157
- CreateShortCut " $SMPROGRAMS\${APNAME}\${APNAME}_editor.lnk" " $INSTDIR\glest_editor.exe" " " " $INSTDIR\glest_editor.exe" 0
158
- CreateShortCut " $SMPROGRAMS\${APNAME}\${APNAME}_viewer.lnk" " $INSTDIR\g3d_viewer.exe" " " " $INSTDIR\g3d_viewer.exe" 0
171
+ CreateShortCut " $SMPROGRAMS\${APNAME}_${APVER} \${APNAME}_${APVER }_config.lnk" " $INSTDIR\glest_configurator.exe" " " " $INSTDIR\glest_configurator.exe" 0
172
+ CreateShortCut " $SMPROGRAMS\${APNAME}_${APVER} \${APNAME}_${APVER }_editor.lnk" " $INSTDIR\glest_editor.exe" " " " $INSTDIR\glest_editor.exe" 0
173
+ CreateShortCut " $SMPROGRAMS\${APNAME}_${APVER} \${APNAME}_${APVER }_viewer.lnk" " $INSTDIR\g3d_viewer.exe" " " " $INSTDIR\g3d_viewer.exe" 0
159
174
160
175
SectionEnd
161
176
@@ -166,8 +181,8 @@ SectionEnd
166
181
Section " Uninstall"
167
182
168
183
; Remove registry keys
169
- DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}"
170
- DeleteRegKey HKLM SOFTWARE\${APNAME}
184
+ DeleteRegKey HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\${APNAME}_${APVER} "
185
+ DeleteRegKey HKLM SOFTWARE\${APNAME} _ ${APVER}
171
186
172
187
; Remove files and uninstaller
173
188
Delete $INSTDIR \uninstall.exe
@@ -204,10 +219,10 @@ Section "Uninstall"
204
219
RMDir /r $INSTDIR \tutorials
205
220
206
221
; Remove shortcuts, if any
207
- Delete " $SMPROGRAMS\${APNAME}\*.*"
222
+ Delete " $SMPROGRAMS\${APNAME}_${APVER} \*.*"
208
223
209
224
; Remove directories used
210
- RMDir " $SMPROGRAMS\${APNAME}"
225
+ RMDir " $SMPROGRAMS\${APNAME}_${APVER} "
211
226
RMDir " $INSTDIR"
212
227
213
228
SectionEnd
0 commit comments