author | darkvater |
Tue, 25 Jan 2005 15:43:27 +0000 | |
changeset 1166 | 18a43f099e76 |
parent 1157 | 5cbea454ba1c |
child 1215 | 6c2fe2311e52 |
permissions | -rw-r--r-- |
0 | 1 |
; Define your application name |
2 |
!define APPNAME "OpenTTD" |
|
1157
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
3 |
!define APPNAMEANDVERSION "OpenTTD 0.3.6.0" |
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
4 |
!define APPVERSION "0.3.6.0" |
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
5 |
!define INSTALLERVERSION 14 ;NEED TO UPDATE THIS FOR EVERY RELEASE!!! |
0 | 6 |
|
7 |
BrandingText "OpenTTD Installer" |
|
8 |
||
9 |
||
10 |
; Version Info |
|
11 |
Var AddWinPrePopulate |
|
250
733e18ca6e93
(svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents:
32
diff
changeset
|
12 |
VIProductVersion "${APPVERSION}" |
0 | 13 |
VIAddVersionKey "ProductName" "OpenTTD Installer" |
14 |
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}" |
|
15 |
VIAddVersionKey "CompanyName" "OpenTTD Developers" |
|
16 |
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}" |
|
17 |
VIAddVersionKey "ProductVersion" "${APPVERSION}" |
|
18 |
VIAddVersionKey "InternalName" "InstOpenTTD" |
|
19 |
VIAddVersionKey "FileVersion" "${APPVERSION}" |
|
20 |
VIAddVersionKey "LegalCopyright" " " |
|
21 |
; Main Install settings |
|
22 |
Name "${APPNAMEANDVERSION}" |
|
23 |
||
24 |
; NOTE: Keep trailing backslash! |
|
25 |
InstallDir "$PROGRAMFILES\OpenTTD\" |
|
26 |
InstallDirRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
27 |
OutFile "openttd-${APPVERSION}-win32.exe" |
0 | 28 |
|
29 |
ShowInstDetails show |
|
30 |
ShowUninstDetails show |
|
31 |
SetCompressor LZMA |
|
32 |
||
33 |
Var SHORTCUTS |
|
34 |
Var CDDRIVE |
|
35 |
||
36 |
; Modern interface settings |
|
37 |
!include "MUI.nsh" |
|
38 |
||
39 |
!define MUI_ABORTWARNING |
|
40 |
||
41 |
!insertmacro MUI_PAGE_WELCOME |
|
42 |
LicenseForceSelection radiobuttons "I &accept this Agreement" "I &do not accept this agreement" |
|
43 |
||
44 |
!insertmacro MUI_PAGE_LICENSE "gpl.txt" |
|
45 |
||
46 |
;-------------------------------- |
|
47 |
; Rest of pages |
|
48 |
!insertmacro MUI_PAGE_COMPONENTS |
|
49 |
||
50 |
||
51 |
;-------------------------------- |
|
52 |
; New custom page for finding CD |
|
53 |
Page custom SelectCD SelectCD2 ": TTD folder" |
|
54 |
||
55 |
!insertmacro MUI_PAGE_DIRECTORY |
|
56 |
||
57 |
;Start Menu Folder Page Configuration |
|
58 |
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $SHORTCUTS |
|
59 |
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKEY_LOCAL_MACHINE" |
|
60 |
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" |
|
61 |
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Shortcut Folder" |
|
62 |
||
63 |
!insertmacro MUI_PAGE_STARTMENU "OpenTTD" $SHORTCUTS |
|
64 |
||
65 |
!insertmacro MUI_PAGE_INSTFILES |
|
66 |
||
67 |
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe" |
|
68 |
!define MUI_FINISHPAGE_LINK "Visit OpenTTD's homepage" |
|
1166
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
69 |
!define MUI_FINISHPAGE_LINK_LOCATION "http://www.openttd.org/" |
0 | 70 |
!define MUI_FINISHPAGE_NOREBOOTSUPPORT |
71 |
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt" |
|
72 |
||
73 |
!insertmacro MUI_PAGE_FINISH |
|
74 |
!insertmacro MUI_UNPAGE_CONFIRM |
|
75 |
!insertmacro MUI_UNPAGE_INSTFILES |
|
76 |
||
77 |
; Set languages (first is default language) |
|
78 |
!insertmacro MUI_LANGUAGE "English" |
|
79 |
!insertmacro MUI_RESERVEFILE_LANGDLL |
|
80 |
||
81 |
;-------------------------------- |
|
82 |
; Sections |
|
83 |
Section "!OpenTTD" Section1 |
|
84 |
||
85 |
; Set Section properties |
|
86 |
SetOverwrite try |
|
87 |
||
88 |
; Make savegame folder |
|
89 |
SetOutPath "$INSTDIR\save" |
|
90 |
; define root variable relative to installer |
|
91 |
!define PATH_ROOT "..\..\..\" |
|
92 |
||
93 |
; Copy language files |
|
94 |
SetOutPath "$INSTDIR\lang\" |
|
95 |
File ${PATH_ROOT}lang\*.lng |
|
96 |
File ${PATH_ROOT}lang\english.txt |
|
97 |
||
98 |
; Copy data files |
|
99 |
SetOutPath "$INSTDIR\data\" |
|
1166
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
100 |
File ${PATH_ROOT}data\*.grf |
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
101 |
File ${PATH_ROOT}data\opntitle.dat |
1157
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
102 |
; Copy scenario files |
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
103 |
SetOutPath "$INSTDIR\scenario\" |
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
104 |
File ${PATH_ROOT}scenario\*.scn |
0 | 105 |
|
106 |
; Copy the rest of the stuff |
|
107 |
SetOutPath "$INSTDIR\" |
|
108 |
||
109 |
;Copy text files |
|
110 |
File ${PATH_ROOT}changelog.txt |
|
250
733e18ca6e93
(svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents:
32
diff
changeset
|
111 |
File ${PATH_ROOT}COPYING |
0 | 112 |
File ${PATH_ROOT}readme.txt |
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
113 |
File ${PATH_ROOT}known-bugs.txt |
0 | 114 |
|
115 |
; Copy executable |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
116 |
File /oname=OpenTTD.exe ${PATH_ROOT}Release\openttd.exe |
1157
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
117 |
File ${PATH_ROOT}strgen\Debug\strgen.exe |
0 | 118 |
|
119 |
||
120 |
; Delete old files from the main dir. they are now placed in data/ and lang/ |
|
121 |
Delete "$INSTDIR\*.lng" |
|
122 |
Delete "$INSTDIR\*.grf" |
|
123 |
Delete "$INSTDIR\sample.cat" |
|
124 |
Delete "$INSTDIR\ttd.exe" |
|
125 |
||
126 |
||
127 |
;Creates the Registry Entries |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
128 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Comments" "Visit http://www.openttd.org" |
0 | 129 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayIcon" "$INSTDIR\setup.ico" |
130 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayName" "OpenTTD ${APPVERSION}" |
|
131 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" "${APPVERSION}" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
132 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "HelpLink" "http://www.openttd.org" |
0 | 133 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" "$INSTDIR" |
134 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Publisher" "OpenTTD" |
|
135 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" "$SHORTCUTS" |
|
136 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" "$INSTDIR\uninstall.exe" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
137 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "URLInfoAbout" "http://www.openttd.org" |
0 | 138 |
;This key sets the Version DWORD that patches will check against |
139 |
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" ${INSTALLERVERSION} |
|
140 |
||
141 |
!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenTTD" |
|
142 |
CreateShortCut "$DESKTOP\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
143 |
CreateDirectory "$SMPROGRAMS\$SHORTCUTS" |
|
144 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
145 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe" |
|
146 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt" |
|
147 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
148 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt" |
0 | 149 |
!insertmacro MUI_STARTMENU_WRITE_END |
150 |
SectionEnd |
|
151 |
||
152 |
Section "Copy Game Graphics" Section2 |
|
153 |
; Include files from CD |
|
154 |
;Let's copy the files from the CD |
|
155 |
SetOutPath "$INSTDIR\gm" |
|
156 |
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\gm\" |
|
157 |
SetOutPath "$INSTDIR\data\" |
|
158 |
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\data\sample.cat" 1566 |
|
159 |
CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\data\trg1r.grf" 2365 |
|
160 |
CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\data\trgcr.grf" 260 |
|
161 |
CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\data\trghr.grf" 400 |
|
162 |
CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\data\trgir.grf" 334 |
|
163 |
CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\data\trgtr.grf" 546 |
|
164 |
SetOutPath "$INSTDIR\" |
|
165 |
SectionEnd |
|
166 |
||
167 |
;---------------------- |
|
168 |
Section -FinishSection |
|
169 |
WriteUninstaller "$INSTDIR\uninstall.exe" |
|
170 |
SectionEnd |
|
171 |
||
172 |
; Modern install component descriptions |
|
173 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|
174 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "OpenTTD is a fully functional clone of TTD and is very playable." |
|
175 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics. Requires TTD for Windows." |
|
176 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
|
177 |
||
178 |
;!undef SHORTCUTS |
|
179 |
;Uninstall section |
|
180 |
||
181 |
Section Uninstall |
|
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
182 |
MessageBox MB_YESNOCANCEL|MB_ICONQUESTION "Would you like to remove the Saved Game Folders located at '$INSTDIR\Save?' If you choose Yes, your Saved Games will be removed." IDYES RemoveSavedGames IDNO NoRemoveSavedGames |
0 | 183 |
RemoveSavedGames: |
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
184 |
Delete "$INSTDIR\Save\AutoSave\*" |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
185 |
RMDir "$INSTDIR\Save\AutoSave" |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
186 |
Delete "$INSTDIR\Save\*" |
0 | 187 |
RMDir "$INSTDIR\Save" |
188 |
NoRemoveSavedGames: |
|
189 |
||
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
190 |
MessageBox MB_YESNOCANCEL|MB_ICONQUESTION "Would you like to remove the Scenario Folders located at '$INSTDIR\Scenario?' If you choose Yes, your Scenarios will be removed." IDYES RemoveScen IDNO NoRemoveScen |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
191 |
RemoveScen: |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
192 |
Delete "$INSTDIR\Scenario\*" |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
193 |
RMDir "$INSTDIR\Scenario" |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
194 |
NoRemoveScen: |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
195 |
|
0 | 196 |
;Remove from registry... |
197 |
!insertmacro MUI_STARTMENU_GETFOLDER "OpenTTD" $SHORTCUTS |
|
198 |
ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" |
|
199 |
||
200 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" |
|
201 |
||
202 |
; Delete self |
|
203 |
Delete "$INSTDIR\uninstall.exe" |
|
204 |
||
205 |
; Delete Shortcuts |
|
206 |
Delete "$DESKTOP\OpenTTD.lnk" |
|
207 |
Delete "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" |
|
208 |
Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" |
|
209 |
Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" |
|
210 |
Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
211 |
Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" |
0 | 212 |
|
213 |
; Clean up OpenTTD dir |
|
214 |
Delete "$INSTDIR\changelog.txt" |
|
215 |
Delete "$INSTDIR\readme.txt" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
216 |
Delete "$INSTDIR\known-bugs.txt" |
0 | 217 |
Delete "$INSTDIR\openttd.exe" |
218 |
Delete "$INSTDIR\strgen.exe" |
|
250
733e18ca6e93
(svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents:
32
diff
changeset
|
219 |
Delete "$INSTDIR\COPYING" |
0 | 220 |
Delete "$INSTDIR\INSTALL.LOG" |
221 |
Delete "$INSTDIR\crash.log" |
|
222 |
Delete "$INSTDIR\openttd.cfg" |
|
1166
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
223 |
Delete "$INSTDIR\hs.dat" |
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
224 |
Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file |
0 | 225 |
|
226 |
; Data files |
|
227 |
Delete "$INSTDIR\data\opntitle.dat" |
|
228 |
Delete "$INSTDIR\data\signalsw.grf" |
|
229 |
Delete "$INSTDIR\data\openttd.grf" |
|
230 |
Delete "$INSTDIR\data\canalsw.grf" |
|
250
733e18ca6e93
(svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents:
32
diff
changeset
|
231 |
Delete "$INSTDIR\data\trkfoundw.grf" |
1166
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
232 |
Delete "$INSTDIR\data\autorail.grf" |
0 | 233 |
Delete "$INSTDIR\data\trg1r.grf" |
234 |
Delete "$INSTDIR\data\trghr.grf" |
|
235 |
Delete "$INSTDIR\data\trgtr.grf" |
|
236 |
Delete "$INSTDIR\data\sample.cat" |
|
237 |
Delete "$INSTDIR\data\trgcr.grf" |
|
238 |
Delete "$INSTDIR\data\trgir.grf" |
|
239 |
||
240 |
;Music |
|
241 |
Delete "$INSTDIR\gm\*.gm" |
|
242 |
||
243 |
;Language files |
|
244 |
Delete "$INSTDIR\lang\*.lng" |
|
245 |
Delete "$INSTDIR\lang\english.txt" |
|
246 |
||
247 |
; Remove remaining directories |
|
248 |
RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\" |
|
249 |
RMDir "$SMPROGRAMS\$SHORTCUTS" |
|
250 |
RMDir "$INSTDIR\gm" |
|
251 |
RMDir "$INSTDIR\lang" |
|
252 |
RMDir "$INSTDIR\data" |
|
253 |
RMDir "$INSTDIR" |
|
254 |
SectionEnd |
|
255 |
||
256 |
Function SelectCD |
|
257 |
SectionGetFlags ${Section2} $0 |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
258 |
IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files |
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
259 |
IntCmp $1 1 DoneCD ;upgrade doesn't need copy files |
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
260 |
|
0 | 261 |
IntOp $0 $0 & 1 |
262 |
IntCmp $0 1 NoAbort |
|
263 |
Abort |
|
264 |
NoAbort: |
|
265 |
||
266 |
GetTempFileName $R0 |
|
267 |
!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue." |
|
268 |
File /oname=$R0 CDFinder.ini |
|
269 |
ClearErrors |
|
270 |
;Now, let's populate $CDDRIVE |
|
271 |
ReadRegStr $CDDRIVE HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath" |
|
272 |
IfErrors NoTTD |
|
273 |
StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next." |
|
274 |
Goto TruFinish |
|
275 |
NoTTD: |
|
276 |
StrCpy $CDDRIVE "" |
|
277 |
StrCpy $AddWinPrePopulate "Setup couldn't find TTD. Please enter the path where the graphics files from TTD for Windows are stored and press Next to continue." |
|
278 |
TruFinish: |
|
279 |
ClearErrors |
|
280 |
WriteINIStr $R0 "Field 2" "State" $CDDRIVE |
|
281 |
WriteINIStr $R0 "Field 3" "Text" $AddWinPrePopulate |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
282 |
DoneCD: |
0 | 283 |
InstallOptions::dialog $R0 |
284 |
Pop $R1 |
|
285 |
FunctionEnd |
|
286 |
||
287 |
; Exit from page function |
|
288 |
Function SelectCD2 |
|
289 |
ReadINIStr $CDDRIVE $R0 "Field 2" "State" |
|
290 |
IfFileExists $CDDRIVE\trg1r.grf "" NoCD |
|
291 |
IfFileExists $CDDRIVE\sample.cat "" NoCD |
|
292 |
IfFileExists $CDDRIVE\trgir.grf hasCD "" |
|
293 |
NoCD: |
|
294 |
MessageBox MB_OK "Setup cannot continue without the Transport Tycoon Deluxe Location!" |
|
295 |
Abort |
|
296 |
hasCD: |
|
297 |
FunctionEnd |
|
298 |
||
299 |
||
300 |
Var OLDVERSION |
|
301 |
Var UninstallString |
|
302 |
||
303 |
Function .onInit |
|
304 |
StrCpy $SHORTCUTS "OpenTTD" |
|
305 |
||
306 |
SectionSetFlags 0 17 |
|
307 |
||
308 |
;Want to have a splash BMP? Uncomment these lines - CAREFUL WITH FILE SIZE |
|
309 |
||
310 |
; # the plugins dir is automatically deleted when the installer exits |
|
311 |
; InitPluginsDir |
|
312 |
; File /oname=$PLUGINSDIR\splash.bmp "C:\Documents and Settings\Administrator\My Documents\My Pictures\OpenTTD Splash.bmp" |
|
313 |
; #optional |
|
314 |
; #File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav" |
|
315 |
; |
|
316 |
; ;MessageBox MB_OK "Fading" |
|
317 |
; |
|
318 |
; advsplash::show 3000 600 400 -1 $PLUGINSDIR\splash |
|
319 |
; |
|
320 |
; Pop $0 ; $0 has '1' if the user closed the splash screen early, |
|
321 |
; ; '0' if everything closed normal, and '-1' if some error occured. |
|
322 |
;End Splash Area |
|
323 |
;Starts Setup - let's look for an older version of OpenTTD |
|
324 |
ReadRegDWORD $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
|
325 |
||
326 |
IfErrors ShowWelcomeMessage ShowUpgradeMessage |
|
327 |
ShowWelcomeMessage: |
|
328 |
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
|
329 |
;In the event someone still has OpenTTD 0.1, this will detect that (that installer used a string instead of dword entry) |
|
330 |
IfErrors FinishCallback |
|
331 |
||
332 |
ShowUpgradeMessage: |
|
333 |
IntCmp ${INSTALLERVERSION} $R8 VersionsAreEqual InstallerIsOlder WelcomeToSetup |
|
334 |
WelcomeToSetup: |
|
335 |
;An older version was found. Let's let the user know there's an upgrade that will take plce. |
|
336 |
ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" |
|
337 |
;Gets the older version then displays it in a message box |
|
338 |
MessageBox MB_OK|MB_ICONINFORMATION "Welcome to ${APPNAMEANDVERSION} Setup.$\n$\nThis will allow you to upgrade from version $OLDVERSION." |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
339 |
SectionSetFlags ${Section2} 0x80 ; set bit 7 |
0 | 340 |
Goto FinishCallback |
341 |
||
342 |
VersionsAreEqual: |
|
343 |
ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" |
|
344 |
IfFileExists "$UninstallString" "" FinishCallback |
|
345 |
MessageBox MB_YESNO|MB_ICONQUESTION "Setup detected ${APPNAMEANDVERSION} on your system. That's the version this program will install.$\n$\nAre you trying to uninstall it?" IDYES DoUninstall IDNO FinishCallback |
|
346 |
DoUninstall: ;You have the same version as this installer. This allows you to uninstall. |
|
347 |
Exec "$UninstallString" |
|
348 |
Quit |
|
349 |
||
350 |
InstallerIsOlder: |
|
351 |
MessageBox MB_OK|MB_ICONSTOP "You have a newer version of ${APPNAME}.$\n$\nSetup will now exit." |
|
352 |
Quit |
|
353 |
||
354 |
FinishCallback: |
|
355 |
ClearErrors |
|
356 |
FunctionEnd |
|
357 |
; eof |
|
358 |