author | KUDr |
Sat, 21 Apr 2007 08:23:57 +0000 | |
branch | cpp_gui |
changeset 6308 | 646711c5feaa |
parent 6303 | 84c215fc8eb8 |
permissions | -rw-r--r-- |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
1 |
!define APPNAME "OpenTTD" ; Define application name |
6303 | 2 |
!define APPVERSION "0.5.1" ; Define application version |
6308 | 3 |
!define INSTALLERVERSION 32 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!! |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
4 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
5 |
!define APPURLLINK "http://www.openttd.org" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
6 |
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
7 |
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
8 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
9 |
!define MUI_ICON "..\..\..\media\openttd.ico" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
10 |
!define MUI_UNICON "..\..\..\media\openttd.ico" |
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
|
11 |
!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
|
12 |
!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
|
13 |
!define MUI_HEADERIMAGE_BITMAP "top.bmp" |
0 | 14 |
|
15 |
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
|
16 |
SetCompressor LZMA |
0 | 17 |
|
18 |
; Version Info |
|
19 |
Var AddWinPrePopulate |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
20 |
VIProductVersion "${APPVERSIONINTERNAL}" |
0 | 21 |
VIAddVersionKey "ProductName" "OpenTTD Installer" |
22 |
VIAddVersionKey "Comments" "Installs ${APPNAMEANDVERSION}" |
|
23 |
VIAddVersionKey "CompanyName" "OpenTTD Developers" |
|
24 |
VIAddVersionKey "FileDescription" "Installs ${APPNAMEANDVERSION}" |
|
25 |
VIAddVersionKey "ProductVersion" "${APPVERSION}" |
|
26 |
VIAddVersionKey "InternalName" "InstOpenTTD" |
|
27 |
VIAddVersionKey "FileVersion" "${APPVERSION}" |
|
28 |
VIAddVersionKey "LegalCopyright" " " |
|
29 |
; Main Install settings |
|
30 |
Name "${APPNAMEANDVERSION}" |
|
31 |
||
32 |
; NOTE: Keep trailing backslash! |
|
33 |
InstallDir "$PROGRAMFILES\OpenTTD\" |
|
34 |
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
|
35 |
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
|
36 |
CRCCheck force |
0 | 37 |
|
38 |
ShowInstDetails show |
|
39 |
ShowUninstDetails show |
|
40 |
||
41 |
Var SHORTCUTS |
|
42 |
Var CDDRIVE |
|
43 |
||
44 |
; Modern interface settings |
|
45 |
!include "MUI.nsh" |
|
46 |
||
47 |
!define MUI_ABORTWARNING |
|
48 |
||
49 |
!insertmacro MUI_PAGE_WELCOME |
|
50 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
51 |
!define MUI_LICENSEPAGE_RADIOBUTTONS |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
52 |
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "I &accept this agreement" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
53 |
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "I &do not accept this agreement" |
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
|
54 |
!insertmacro MUI_PAGE_LICENSE "..\..\..\COPYING" |
0 | 55 |
|
56 |
!insertmacro MUI_PAGE_COMPONENTS |
|
57 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
58 |
;--------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
59 |
; Custom page for finding TTDLX CD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
60 |
Page custom SelectCDEnter SelectCDExit ": TTD folder" |
0 | 61 |
|
62 |
!insertmacro MUI_PAGE_DIRECTORY |
|
63 |
||
64 |
;Start Menu Folder Page Configuration |
|
65 |
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $SHORTCUTS |
|
66 |
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKEY_LOCAL_MACHINE" |
|
67 |
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" |
|
68 |
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Shortcut Folder" |
|
69 |
||
70 |
!insertmacro MUI_PAGE_STARTMENU "OpenTTD" $SHORTCUTS |
|
71 |
||
72 |
!insertmacro MUI_PAGE_INSTFILES |
|
73 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
74 |
;----------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
75 |
; New custom page to show UNICODE and MSLU information |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
76 |
Page custom ShowWarningsPage |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
77 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
78 |
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
79 |
!define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for latest news, FAQs and downloads" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
80 |
!define MUI_FINISHPAGE_LINK_LOCATION "${APPURLLINK}" |
0 | 81 |
!define MUI_FINISHPAGE_NOREBOOTSUPPORT |
82 |
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt" |
|
1821 | 83 |
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED |
0 | 84 |
|
85 |
!insertmacro MUI_PAGE_FINISH |
|
86 |
!insertmacro MUI_UNPAGE_CONFIRM |
|
87 |
!insertmacro MUI_UNPAGE_INSTFILES |
|
88 |
||
89 |
; Set languages (first is default language) |
|
90 |
!insertmacro MUI_LANGUAGE "English" |
|
91 |
!insertmacro MUI_RESERVEFILE_LANGDLL |
|
92 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
93 |
;-------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
94 |
; (Core) OpenTTD install section. Copies all internal game data |
0 | 95 |
Section "!OpenTTD" Section1 |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
96 |
; Overwrite files by default, but don't complain on failure |
0 | 97 |
SetOverwrite try |
98 |
||
99 |
; Make savegame folder |
|
100 |
SetOutPath "$INSTDIR\save" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
101 |
; Define root variable relative to installer |
0 | 102 |
!define PATH_ROOT "..\..\..\" |
103 |
||
104 |
; Copy language files |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
105 |
SetOutPath "$INSTDIR\lang\" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
106 |
File ${PATH_ROOT}bin\lang\*.lng |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
107 |
File ${PATH_ROOT}src\lang\english.txt |
0 | 108 |
|
109 |
; Copy data files |
|
110 |
SetOutPath "$INSTDIR\data\" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
111 |
File ${PATH_ROOT}bin\data\*.grf |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
112 |
File ${PATH_ROOT}bin\data\opntitle.dat |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
113 |
; Copy scenario files (don't choke if they don't exist) |
1157
5cbea454ba1c
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
114 |
SetOutPath "$INSTDIR\scenario\" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
115 |
File /nonfatal ${PATH_ROOT}bin\scenario\*.scn |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
116 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
117 |
; Copy heightmap files (don't choke if they don't exist) |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
118 |
SetOutPath "$INSTDIR\scenario\heightmap\" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
119 |
File /nonfatal ${PATH_ROOT}bin\scenario\heightmap\*.* |
0 | 120 |
|
121 |
; Copy the rest of the stuff |
|
122 |
SetOutPath "$INSTDIR\" |
|
123 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
124 |
; Copy text files |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
125 |
File ${PATH_ROOT}changelog.txt |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
126 |
File ${PATH_ROOT}COPYING |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
127 |
File ${PATH_ROOT}readme.txt |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
128 |
File ${PATH_ROOT}known-bugs.txt |
0 | 129 |
|
130 |
; Copy executable |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
131 |
File /oname=openttd.exe ${PATH_ROOT}objs\Win32\Release\openttd.exe |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
132 |
File ${PATH_ROOT}objs\strgen\strgen.exe |
0 | 133 |
|
134 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
135 |
; Delete old files from the main dir. they are now placed in data/ and lang/ |
0 | 136 |
Delete "$INSTDIR\*.lng" |
137 |
Delete "$INSTDIR\*.grf" |
|
138 |
Delete "$INSTDIR\sample.cat" |
|
139 |
Delete "$INSTDIR\ttd.exe" |
|
140 |
||
141 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
142 |
; Create the Registry Entries |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
143 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Comments" "Visit ${APPURLLINK}" |
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
|
144 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayIcon" "$INSTDIR\openttd.exe,0" |
0 | 145 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayName" "OpenTTD ${APPVERSION}" |
146 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" "${APPVERSION}" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
147 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "HelpLink" "${APPURLLINK}" |
0 | 148 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" "$INSTDIR" |
149 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Publisher" "OpenTTD" |
|
150 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" "$SHORTCUTS" |
|
151 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" "$INSTDIR\uninstall.exe" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
152 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "URLInfoAbout" "${APPURLLINK}" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
153 |
; This key sets the Version DWORD that new installers will check against |
0 | 154 |
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" ${INSTALLERVERSION} |
155 |
||
156 |
!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenTTD" |
|
157 |
CreateShortCut "$DESKTOP\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
158 |
CreateDirectory "$SMPROGRAMS\$SHORTCUTS" |
|
159 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
160 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe" |
|
161 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt" |
|
162 |
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
|
163 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt" |
0 | 164 |
!insertmacro MUI_STARTMENU_WRITE_END |
165 |
SectionEnd |
|
166 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
167 |
;---------------------------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
168 |
; TTDLX files install section. Copies all needed TTDLX files from CD or install dir |
0 | 169 |
Section "Copy Game Graphics" Section2 |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
170 |
; Let's copy the files with size approximation |
0 | 171 |
SetOutPath "$INSTDIR\gm" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
172 |
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\gm\" 1028 |
0 | 173 |
SetOutPath "$INSTDIR\data\" |
174 |
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\data\sample.cat" 1566 |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
175 |
; Copy Windows files |
0 | 176 |
CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\data\trg1r.grf" 2365 |
177 |
CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\data\trgcr.grf" 260 |
|
178 |
CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\data\trghr.grf" 400 |
|
179 |
CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\data\trgir.grf" 334 |
|
180 |
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
|
181 |
; 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
|
182 |
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
|
183 |
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
|
184 |
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
|
185 |
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
|
186 |
CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\data\trgt.grf" 546 |
0 | 187 |
SetOutPath "$INSTDIR\" |
188 |
SectionEnd |
|
189 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
190 |
;------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
191 |
; Install the uninstaller (option is hidden) |
0 | 192 |
Section -FinishSection |
193 |
WriteUninstaller "$INSTDIR\uninstall.exe" |
|
194 |
SectionEnd |
|
195 |
||
196 |
; Modern install component descriptions |
|
197 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|
198 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "OpenTTD is a fully functional clone of TTD and is very playable." |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
199 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics. Requires TTD (for Windows)." |
0 | 200 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
201 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
202 |
;----------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
203 |
; Uninstall section, deletes all installed files |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
204 |
Section "Uninstall" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
205 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
206 |
"Remove the save game folders located at $\"$INSTDIR\save?$\"$\n \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
207 |
If you choose Yes, your saved games will be deleted." \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
208 |
IDYES RemoveSavedGames IDNO NoRemoveSavedGames |
0 | 209 |
RemoveSavedGames: |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
210 |
Delete "$INSTDIR\save\autosave\*" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
211 |
RMDir "$INSTDIR\save\autosave" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
212 |
Delete "$INSTDIR\save\*" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
213 |
RMDir "$INSTDIR\save" |
0 | 214 |
NoRemoveSavedGames: |
215 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
216 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
217 |
"Remove the scenario folders located at $\"$INSTDIR\scenario?$\"$\n \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
218 |
If you choose Yes, your scenarios will be deleted." \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
219 |
IDYES RemoveScen IDNO NoRemoveScen |
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
220 |
RemoveScen: |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
221 |
Delete "$INSTDIR\scenario\heightmap*" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
222 |
RMDir "$INSTDIR\scenario\heightmap" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
223 |
Delete "$INSTDIR\scenario\*" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
224 |
RMDir "$INSTDIR\scenario" |
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
225 |
NoRemoveScen: |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
226 |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
227 |
; Remove from registry... |
0 | 228 |
!insertmacro MUI_STARTMENU_GETFOLDER "OpenTTD" $SHORTCUTS |
229 |
ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" |
|
230 |
||
231 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" |
|
232 |
||
233 |
; Delete self |
|
234 |
Delete "$INSTDIR\uninstall.exe" |
|
235 |
||
236 |
; Delete Shortcuts |
|
237 |
Delete "$DESKTOP\OpenTTD.lnk" |
|
238 |
Delete "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" |
|
239 |
Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" |
|
240 |
Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" |
|
241 |
Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
242 |
Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" |
0 | 243 |
|
244 |
; Clean up OpenTTD dir |
|
245 |
Delete "$INSTDIR\changelog.txt" |
|
246 |
Delete "$INSTDIR\readme.txt" |
|
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
247 |
Delete "$INSTDIR\known-bugs.txt" |
0 | 248 |
Delete "$INSTDIR\openttd.exe" |
249 |
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
|
250 |
Delete "$INSTDIR\COPYING" |
0 | 251 |
Delete "$INSTDIR\INSTALL.LOG" |
252 |
Delete "$INSTDIR\crash.log" |
|
253 |
Delete "$INSTDIR\openttd.cfg" |
|
1166
18a43f099e76
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
254 |
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
|
255 |
Delete "$INSTDIR\cached_sprites.*" |
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
256 |
Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file |
0 | 257 |
|
258 |
; Data files |
|
259 |
Delete "$INSTDIR\data\opntitle.dat" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
260 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
261 |
Delete "$INSTDIR\data\2ccmap.grf" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
262 |
Delete "$INSTDIR\data\airports.grf" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
263 |
Delete "$INSTDIR\data\autorail.grf" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
264 |
Delete "$INSTDIR\data\canalsw.grf" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
265 |
Delete "$INSTDIR\data\dosdummy.grf" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
266 |
Delete "$INSTDIR\data\elrailsw.grf" |
2946
576b2836633c
(svn r3502) - Update appropiate files with release information for 0.4.5
Darkvater
parents:
1848
diff
changeset
|
267 |
Delete "$INSTDIR\data\nsignalsw.grf" |
0 | 268 |
Delete "$INSTDIR\data\openttd.grf" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
269 |
Delete "$INSTDIR\data\roadstops.grf" |
250
733e18ca6e93
(svn r251) -Project ready for 0.3.4 release. Updated installer, readme and fileinformation
darkvater
parents:
32
diff
changeset
|
270 |
Delete "$INSTDIR\data\trkfoundw.grf" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
271 |
|
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
|
272 |
Delete "$INSTDIR\data\sample.cat" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
273 |
; Windows Data files |
0 | 274 |
Delete "$INSTDIR\data\trg1r.grf" |
275 |
Delete "$INSTDIR\data\trghr.grf" |
|
276 |
Delete "$INSTDIR\data\trgtr.grf" |
|
277 |
Delete "$INSTDIR\data\trgcr.grf" |
|
278 |
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
|
279 |
; 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
|
280 |
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
|
281 |
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
|
282 |
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
|
283 |
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
|
284 |
Delete "$INSTDIR\data\trgi.grf" |
0 | 285 |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
286 |
; Music |
0 | 287 |
Delete "$INSTDIR\gm\*.gm" |
288 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
289 |
; Language files |
0 | 290 |
Delete "$INSTDIR\lang\*.lng" |
291 |
Delete "$INSTDIR\lang\english.txt" |
|
292 |
||
293 |
; Remove remaining directories |
|
294 |
RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\" |
|
295 |
RMDir "$SMPROGRAMS\$SHORTCUTS" |
|
296 |
RMDir "$INSTDIR\gm" |
|
297 |
RMDir "$INSTDIR\lang" |
|
298 |
RMDir "$INSTDIR\data" |
|
299 |
RMDir "$INSTDIR" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
300 |
|
0 | 301 |
SectionEnd |
302 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
303 |
;------------------------------------------------------------ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
304 |
; Custom page function to find the TTDLX CD/install location |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
305 |
Function SelectCDEnter |
0 | 306 |
SectionGetFlags ${Section2} $0 |
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
307 |
IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
308 |
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
|
309 |
|
0 | 310 |
IntOp $0 $0 & 1 |
311 |
IntCmp $0 1 NoAbort |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
312 |
Abort |
0 | 313 |
NoAbort: |
314 |
||
315 |
GetTempFileName $R0 |
|
316 |
!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue." |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
317 |
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "CDFinder.ini" "CDFinder" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
318 |
|
0 | 319 |
ClearErrors |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
320 |
; Now, let's populate $CDDRIVE |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
321 |
ReadRegStr $R0 HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath" |
0 | 322 |
IfErrors NoTTD |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
323 |
StrCmp $CDDRIVE "" 0 Populated |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
324 |
StrCpy $CDDRIVE $R0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
325 |
Populated: |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
326 |
StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next." |
0 | 327 |
Goto TruFinish |
328 |
NoTTD: |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
329 |
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 | 330 |
TruFinish: |
331 |
ClearErrors |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
332 |
!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 2" "State" $CDDRIVE ; TTDLX path |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
333 |
!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 3" "Text" $AddWinPrePopulate ; Caption |
801
bfa47ec110b0
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
334 |
DoneCD: |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
335 |
; Initialize the dialog *AFTER* we've changed the text otherwise we won't see the changes |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
336 |
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "CDFinder" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
337 |
!insertmacro MUI_INSTALLOPTIONS_SHOW |
0 | 338 |
FunctionEnd |
339 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
340 |
;---------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
341 |
; Custom page function when 'next' is selected for the TTDLX path |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
342 |
Function SelectCDExit |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
343 |
!insertmacro MUI_INSTALLOPTIONS_READ $CDDRIVE "CDFinder" "Field 2" "State" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
344 |
; If trg1r.grf does not exist at the path, retry with DOS version |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
345 |
IfFileExists $CDDRIVE\trg1r.grf "" DosCD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
346 |
IfFileExists $CDDRIVE\trgir.grf "" NoCD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
347 |
IfFileExists $CDDRIVE\sample.cat hasCD NoCD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
348 |
DosCD: |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
349 |
IfFileExists $CDDRIVE\TRG1.GRF "" NoCD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
350 |
IfFileExists $CDDRIVE\TRGI.GRF "" NoCD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
351 |
IfFileExists $CDDRIVE\SAMPLE.CAT hasCD NoCD |
0 | 352 |
NoCD: |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
353 |
MessageBox MB_OK "Setup cannot continue without the Transport Tycoon Deluxe Location!" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
354 |
Abort |
0 | 355 |
hasCD: |
356 |
FunctionEnd |
|
357 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
358 |
;--------------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
359 |
; Custom page function to show notices for running OpenTTD |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
360 |
; We have extracted this custom page as Notice in the .onInit function |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
361 |
Function ShowWarningsPage |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
362 |
!insertmacro MUI_HEADER_TEXT "Installation Complete" "Important notices for OpenTTD usage." |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
363 |
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "notice.ini" "Notice" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
364 |
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Notice" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
365 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
366 |
Call GetWindowsVersion |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
367 |
Pop $R0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
368 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
369 |
; Hide the MSLU text if the installer is not run on Win9x systems |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
370 |
StrCmp $R0 "winnt" 0 Win9x |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
371 |
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 1" "HWND" ; MSLU groupbox |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
372 |
ShowWindow $R1 0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
373 |
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 2" "HWND" ; MSLU text |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
374 |
ShowWindow $R1 0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
375 |
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 3" "HWND" ; MSLU link |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
376 |
ShowWindow $R1 0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
377 |
Win9x: |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
378 |
ClearErrors |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
379 |
!insertmacro MUI_INSTALLOPTIONS_SHOW |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
380 |
FunctionEnd |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
381 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
382 |
;------------------------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
383 |
; Determine windows version, returns "win9x" if Win9x/Me or "winnt" on the stack |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
384 |
Function GetWindowsVersion |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
385 |
ClearErrors |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
386 |
StrCpy $R0 "winnt" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
387 |
|
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
388 |
ReadRegStr $R1 HKLM "SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion" CurrentVersion |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
389 |
IfErrors 0 WinNT |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
390 |
StrCpy $R0 "win9x" |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
391 |
WinNT: |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
392 |
ClearErrors |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
393 |
Push $R0 |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
394 |
FunctionEnd |
0 | 395 |
|
396 |
Var OLDVERSION |
|
397 |
Var UninstallString |
|
398 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
399 |
;----------------------------------------------------------------------------------- |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
400 |
; NSIS Initialize function, determin if we are going to install/upgrade or uninstall |
0 | 401 |
Function .onInit |
402 |
StrCpy $SHORTCUTS "OpenTTD" |
|
403 |
||
404 |
SectionSetFlags 0 17 |
|
405 |
||
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
406 |
; Starts Setup - let's look for an older version of OpenTTD |
0 | 407 |
ReadRegDWORD $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
408 |
||
409 |
IfErrors ShowWelcomeMessage ShowUpgradeMessage |
|
410 |
ShowWelcomeMessage: |
|
411 |
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
412 |
; In the event someone still has OpenTTD 0.1, this will detect that (that installer used a string instead of dword entry) |
0 | 413 |
IfErrors FinishCallback |
414 |
||
415 |
ShowUpgradeMessage: |
|
416 |
IntCmp ${INSTALLERVERSION} $R8 VersionsAreEqual InstallerIsOlder WelcomeToSetup |
|
417 |
WelcomeToSetup: |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
418 |
; An older version was found. Let's let the user know there's an upgrade that will take place. |
0 | 419 |
ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" |
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
420 |
; Gets the older version then displays it in a message box |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
421 |
MessageBox MB_OK|MB_ICONINFORMATION \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
422 |
"Welcome to ${APPNAMEANDVERSION} Setup.$\n \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
423 |
This 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
|
424 |
SectionSetFlags ${Section2} 0x80 ; set bit 7 |
0 | 425 |
Goto FinishCallback |
426 |
||
427 |
VersionsAreEqual: |
|
428 |
ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" |
|
429 |
IfFileExists "$UninstallString" "" FinishCallback |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
430 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
431 |
"Setup detected ${APPNAMEANDVERSION} on your system. That's the version this program will install.$\n \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
432 |
Are you trying to uninstall it?" \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
433 |
IDYES DoUninstall IDNO FinishCallback |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
434 |
DoUninstall: ; You have the same version as this installer. This allows you to uninstall. |
0 | 435 |
Exec "$UninstallString" |
436 |
Quit |
|
437 |
||
438 |
InstallerIsOlder: |
|
6285
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
439 |
MessageBox MB_OK|MB_ICONSTOP \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
440 |
"You have a newer version of ${APPNAME}.$\n \ |
187e3ef04cc9
(svn r9004) [cpp_gui] -Sync with trunk (r8900..r9003)
KUDr
parents:
6216
diff
changeset
|
441 |
Setup will now exit." |
0 | 442 |
Quit |
443 |
||
444 |
FinishCallback: |
|
445 |
ClearErrors |
|
446 |
FunctionEnd |
|
447 |
; eof |
|
448 |