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