author | rubidium |
Wed, 30 May 2007 18:24:54 +0000 | |
changeset 6755 | 7cca96e92189 |
parent 6745 | 238ec04a86d4 |
child 7106 | 6cef540ecbe0 |
permissions | -rw-r--r-- |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
1 |
!define APPNAME "OpenTTD" ; Define application name |
6744 | 2 |
!define APPVERSION "0.5.2" ; Define application version |
3 |
!define INSTALLERVERSION 34 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!! |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
4 |
|
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
5 |
!define APPURLLINK "http://www.openttd.org" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
6 |
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
7 |
!define APPVERSIONINTERNAL "${APPVERSION}.0" ; Needs to be of the format X.X.X.X |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
8 |
|
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
9 |
!define MUI_ICON "..\..\..\media\openttd.ico" |
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
10 |
!define MUI_UNICON "..\..\..\media\openttd.ico" |
1215
b314a2e81968
(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" |
b314a2e81968
(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 |
b314a2e81968
(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
b314a2e81968
(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 |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
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
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
35 |
OutFile "openttd-${APPVERSION}-win32.exe" |
1215
b314a2e81968
(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 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
51 |
!define MUI_LICENSEPAGE_RADIOBUTTONS |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
52 |
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "I &accept this agreement" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
53 |
!insertmacro MUI_DEFAULT MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "I &do not accept this agreement" |
1215
b314a2e81968
(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 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
58 |
;--------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
59 |
; Custom page for finding TTDLX CD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
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 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
74 |
;----------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
75 |
; New custom page to show UNICODE and MSLU information |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
76 |
Page custom ShowWarningsPage |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
77 |
|
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
78 |
!define MUI_FINISHPAGE_RUN "$INSTDIR\openttd.exe" |
6170
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
79 |
!define MUI_FINISHPAGE_LINK "Visit the OpenTTD site for latest news, FAQs and downloads" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
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 |
6745
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
84 |
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack |
0 | 85 |
|
86 |
!insertmacro MUI_PAGE_FINISH |
|
87 |
!insertmacro MUI_UNPAGE_CONFIRM |
|
88 |
!insertmacro MUI_UNPAGE_INSTFILES |
|
89 |
||
90 |
; Set languages (first is default language) |
|
91 |
!insertmacro MUI_LANGUAGE "English" |
|
92 |
!insertmacro MUI_RESERVEFILE_LANGDLL |
|
93 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
94 |
;-------------------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
95 |
; (Core) OpenTTD install section. Copies all internal game data |
0 | 96 |
Section "!OpenTTD" Section1 |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
97 |
; Overwrite files by default, but don't complain on failure |
0 | 98 |
SetOverwrite try |
99 |
||
100 |
; Make savegame folder |
|
101 |
SetOutPath "$INSTDIR\save" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
102 |
; Define root variable relative to installer |
0 | 103 |
!define PATH_ROOT "..\..\..\" |
104 |
||
105 |
; Copy language files |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
106 |
SetOutPath "$INSTDIR\lang\" |
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
107 |
File ${PATH_ROOT}bin\lang\*.lng |
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
108 |
File ${PATH_ROOT}src\lang\english.txt |
0 | 109 |
|
110 |
; Copy data files |
|
111 |
SetOutPath "$INSTDIR\data\" |
|
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
112 |
File ${PATH_ROOT}bin\data\*.grf |
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
113 |
File ${PATH_ROOT}bin\data\opntitle.dat |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
114 |
; Copy scenario files (don't choke if they don't exist) |
1157
0047fb918f48
(svn r1658) -Update readme and windows installer for 0.3.6
darkvater
parents:
801
diff
changeset
|
115 |
SetOutPath "$INSTDIR\scenario\" |
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
116 |
File /nonfatal ${PATH_ROOT}bin\scenario\*.scn |
0 | 117 |
|
6170
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
118 |
; Copy heightmap files (don't choke if they don't exist) |
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
119 |
SetOutPath "$INSTDIR\scenario\heightmap\" |
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
120 |
File /nonfatal ${PATH_ROOT}bin\scenario\heightmap\*.* |
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
121 |
|
0 | 122 |
; Copy the rest of the stuff |
123 |
SetOutPath "$INSTDIR\" |
|
124 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
125 |
; Copy text files |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
126 |
File ${PATH_ROOT}changelog.txt |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
127 |
File ${PATH_ROOT}COPYING |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
128 |
File ${PATH_ROOT}readme.txt |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
129 |
File ${PATH_ROOT}known-bugs.txt |
0 | 130 |
|
131 |
; Copy executable |
|
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
132 |
File /oname=openttd.exe ${PATH_ROOT}objs\Win32\Release\openttd.exe |
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
133 |
File ${PATH_ROOT}objs\strgen\strgen.exe |
0 | 134 |
|
135 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
136 |
; Delete old files from the main dir. they are now placed in data/ and lang/ |
0 | 137 |
Delete "$INSTDIR\*.lng" |
138 |
Delete "$INSTDIR\*.grf" |
|
139 |
Delete "$INSTDIR\sample.cat" |
|
140 |
Delete "$INSTDIR\ttd.exe" |
|
141 |
||
142 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
143 |
; Create the Registry Entries |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
144 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Comments" "Visit ${APPURLLINK}" |
1215
b314a2e81968
(svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents:
1166
diff
changeset
|
145 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayIcon" "$INSTDIR\openttd.exe,0" |
0 | 146 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayName" "OpenTTD ${APPVERSION}" |
147 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" "${APPVERSION}" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
148 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "HelpLink" "${APPURLLINK}" |
0 | 149 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Install Folder" "$INSTDIR" |
150 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Publisher" "OpenTTD" |
|
151 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" "$SHORTCUTS" |
|
152 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" "$INSTDIR\uninstall.exe" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
153 |
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "URLInfoAbout" "${APPURLLINK}" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
154 |
; This key sets the Version DWORD that new installers will check against |
0 | 155 |
WriteRegDWORD HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" ${INSTALLERVERSION} |
156 |
||
157 |
!insertmacro MUI_STARTMENU_WRITE_BEGIN "OpenTTD" |
|
158 |
CreateShortCut "$DESKTOP\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
159 |
CreateDirectory "$SMPROGRAMS\$SHORTCUTS" |
|
160 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" "$INSTDIR\openttd.exe" |
|
161 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" "$INSTDIR\uninstall.exe" |
|
162 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" "$INSTDIR\Readme.txt" |
|
163 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" "$INSTDIR\Changelog.txt" |
|
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
164 |
CreateShortCut "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" "$INSTDIR\known-bugs.txt" |
0 | 165 |
!insertmacro MUI_STARTMENU_WRITE_END |
166 |
SectionEnd |
|
167 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
168 |
;---------------------------------------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
169 |
; TTDLX files install section. Copies all needed TTDLX files from CD or install dir |
0 | 170 |
Section "Copy Game Graphics" Section2 |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
171 |
; Let's copy the files with size approximation |
0 | 172 |
SetOutPath "$INSTDIR\gm" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
173 |
CopyFiles "$CDDRIVE\gm\*.gm" "$INSTDIR\gm\" 1028 |
0 | 174 |
SetOutPath "$INSTDIR\data\" |
175 |
CopyFiles "$CDDRIVE\sample.cat" "$INSTDIR\data\sample.cat" 1566 |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
176 |
; Copy Windows files |
0 | 177 |
CopyFiles "$CDDRIVE\trg1r.grf" "$INSTDIR\data\trg1r.grf" 2365 |
178 |
CopyFiles "$CDDRIVE\trgcr.grf" "$INSTDIR\data\trgcr.grf" 260 |
|
179 |
CopyFiles "$CDDRIVE\trghr.grf" "$INSTDIR\data\trghr.grf" 400 |
|
180 |
CopyFiles "$CDDRIVE\trgir.grf" "$INSTDIR\data\trgir.grf" 334 |
|
181 |
CopyFiles "$CDDRIVE\trgtr.grf" "$INSTDIR\data\trgtr.grf" 546 |
|
1215
b314a2e81968
(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 |
; Copy DOS files |
b314a2e81968
(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\trg1.grf" "$INSTDIR\data\trg1.grf" 2365 |
b314a2e81968
(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\trgc.grf" "$INSTDIR\data\trgc.grf" 260 |
b314a2e81968
(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\trgh.grf" "$INSTDIR\data\trgh.grf" 400 |
b314a2e81968
(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\trgi.grf" "$INSTDIR\data\trgi.grf" 334 |
b314a2e81968
(svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents:
1166
diff
changeset
|
187 |
CopyFiles "$CDDRIVE\trgt.grf" "$INSTDIR\data\trgt.grf" 546 |
0 | 188 |
SetOutPath "$INSTDIR\" |
189 |
SectionEnd |
|
190 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
191 |
;------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
192 |
; Install the uninstaller (option is hidden) |
0 | 193 |
Section -FinishSection |
194 |
WriteUninstaller "$INSTDIR\uninstall.exe" |
|
195 |
SectionEnd |
|
196 |
||
197 |
; Modern install component descriptions |
|
198 |
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN |
|
199 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "OpenTTD is a fully functional clone of TTD and is very playable." |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
200 |
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics. Requires TTD (for Windows)." |
0 | 201 |
!insertmacro MUI_FUNCTION_DESCRIPTION_END |
202 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
203 |
;----------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
204 |
; Uninstall section, deletes all installed files |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
205 |
Section "Uninstall" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
206 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
207 |
"Remove the save game folders located at $\"$INSTDIR\save?$\"$\n \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
208 |
If you choose Yes, your saved games will be deleted." \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
209 |
IDYES RemoveSavedGames IDNO NoRemoveSavedGames |
0 | 210 |
RemoveSavedGames: |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
211 |
Delete "$INSTDIR\save\autosave\*" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
212 |
RMDir "$INSTDIR\save\autosave" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
213 |
Delete "$INSTDIR\save\*" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
214 |
RMDir "$INSTDIR\save" |
0 | 215 |
NoRemoveSavedGames: |
216 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
217 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
218 |
"Remove the scenario folders located at $\"$INSTDIR\scenario?$\"$\n \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
219 |
If you choose Yes, your scenarios will be deleted." \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
220 |
IDYES RemoveScen IDNO NoRemoveScen |
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
221 |
RemoveScen: |
6170
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
222 |
Delete "$INSTDIR\scenario\heightmap*" |
abff1cff6903
(svn r8929) -Codechange: [win32] Give the installer a slightly more verbose link at the final screen and also copy any heightmaps to the desination directory.
Darkvater
parents:
6169
diff
changeset
|
223 |
RMDir "$INSTDIR\scenario\heightmap" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
224 |
Delete "$INSTDIR\scenario\*" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
225 |
RMDir "$INSTDIR\scenario" |
31
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
226 |
NoRemoveScen: |
85a8c911441c
(svn r32) -Fix [1007277] Windows Installer Fixes for bugs [991118] and [991102]. (lucaspiller)
darkvater
parents:
0
diff
changeset
|
227 |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
228 |
; Remove from registry... |
0 | 229 |
!insertmacro MUI_STARTMENU_GETFOLDER "OpenTTD" $SHORTCUTS |
230 |
ReadRegStr $SHORTCUTS HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Shortcut Folder" |
|
231 |
||
232 |
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" |
|
233 |
||
234 |
; Delete self |
|
235 |
Delete "$INSTDIR\uninstall.exe" |
|
236 |
||
237 |
; Delete Shortcuts |
|
238 |
Delete "$DESKTOP\OpenTTD.lnk" |
|
239 |
Delete "$SMPROGRAMS\$SHORTCUTS\OpenTTD.lnk" |
|
240 |
Delete "$SMPROGRAMS\$SHORTCUTS\Uninstall.lnk" |
|
241 |
Delete "$SMPROGRAMS\$SHORTCUTS\Readme.lnk" |
|
242 |
Delete "$SMPROGRAMS\$SHORTCUTS\Changelog.lnk" |
|
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
243 |
Delete "$SMPROGRAMS\$SHORTCUTS\Known-bugs.lnk" |
0 | 244 |
|
245 |
; Clean up OpenTTD dir |
|
246 |
Delete "$INSTDIR\changelog.txt" |
|
247 |
Delete "$INSTDIR\readme.txt" |
|
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
248 |
Delete "$INSTDIR\known-bugs.txt" |
0 | 249 |
Delete "$INSTDIR\openttd.exe" |
250 |
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
|
251 |
Delete "$INSTDIR\COPYING" |
0 | 252 |
Delete "$INSTDIR\INSTALL.LOG" |
253 |
Delete "$INSTDIR\crash.log" |
|
254 |
Delete "$INSTDIR\openttd.cfg" |
|
1166
b63b1732a1b9
(svn r1668) -Fixed windows installer (autorail.grf) and a changelog typo
darkvater
parents:
1157
diff
changeset
|
255 |
Delete "$INSTDIR\hs.dat" |
1841
1f3f4039dc85
(svn r2346) - Fix: Have the windows installer also delete any spritecache.xx files on uninstall
Darkvater
parents:
1821
diff
changeset
|
256 |
Delete "$INSTDIR\cached_sprites.*" |
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
257 |
Delete "$INSTDIR\save\autosave\network*.tmp" ; temporary network file |
0 | 258 |
|
259 |
; Data files |
|
260 |
Delete "$INSTDIR\data\opntitle.dat" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
261 |
|
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
262 |
Delete "$INSTDIR\data\2ccmap.grf" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
263 |
Delete "$INSTDIR\data\airports.grf" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
264 |
Delete "$INSTDIR\data\autorail.grf" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
265 |
Delete "$INSTDIR\data\canalsw.grf" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
266 |
Delete "$INSTDIR\data\dosdummy.grf" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
267 |
Delete "$INSTDIR\data\elrailsw.grf" |
2946
f2b2379f3964
(svn r3502) - Update appropiate files with release information for 0.4.5
Darkvater
parents:
1848
diff
changeset
|
268 |
Delete "$INSTDIR\data\nsignalsw.grf" |
0 | 269 |
Delete "$INSTDIR\data\openttd.grf" |
6169
68de0fd4c517
(svn r8927) -Codechange: [win32] Update the installer to use the new paths after the makefilerewrite and add roadstops.grf to the uninstaller.
Darkvater
parents:
6168
diff
changeset
|
270 |
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
|
271 |
Delete "$INSTDIR\data\trkfoundw.grf" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
272 |
|
1215
b314a2e81968
(svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents:
1166
diff
changeset
|
273 |
Delete "$INSTDIR\data\sample.cat" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
274 |
; Windows Data files |
0 | 275 |
Delete "$INSTDIR\data\trg1r.grf" |
276 |
Delete "$INSTDIR\data\trghr.grf" |
|
277 |
Delete "$INSTDIR\data\trgtr.grf" |
|
278 |
Delete "$INSTDIR\data\trgcr.grf" |
|
279 |
Delete "$INSTDIR\data\trgir.grf" |
|
1215
b314a2e81968
(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 |
; Dos Data files |
b314a2e81968
(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\trg1.grf" |
b314a2e81968
(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\trgh.grf" |
b314a2e81968
(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\trgt.grf" |
b314a2e81968
(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\trgc.grf" |
b314a2e81968
(svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents:
1166
diff
changeset
|
285 |
Delete "$INSTDIR\data\trgi.grf" |
0 | 286 |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
287 |
; Music |
0 | 288 |
Delete "$INSTDIR\gm\*.gm" |
289 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
290 |
; Language files |
0 | 291 |
Delete "$INSTDIR\lang\*.lng" |
292 |
Delete "$INSTDIR\lang\english.txt" |
|
293 |
||
294 |
; Remove remaining directories |
|
295 |
RMDir "$SMPROGRAMS\$SHORTCUTS\Extras\" |
|
296 |
RMDir "$SMPROGRAMS\$SHORTCUTS" |
|
297 |
RMDir "$INSTDIR\gm" |
|
298 |
RMDir "$INSTDIR\lang" |
|
299 |
RMDir "$INSTDIR\data" |
|
300 |
RMDir "$INSTDIR" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
301 |
|
0 | 302 |
SectionEnd |
303 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
304 |
;------------------------------------------------------------ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
305 |
; Custom page function to find the TTDLX CD/install location |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
306 |
Function SelectCDEnter |
0 | 307 |
SectionGetFlags ${Section2} $0 |
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
308 |
IntOp $1 $0 & 0x80 ; bit 7 set by upgrade, no need to copy files |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
309 |
IntCmp $1 1 DoneCD ; Upgrade doesn't need copy files |
1215
b314a2e81968
(svn r1719) - Fix: [installer] fix some installer problems mainly for DOS files as well as beautify it a little
darkvater
parents:
1166
diff
changeset
|
310 |
|
0 | 311 |
IntOp $0 $0 & 1 |
312 |
IntCmp $0 1 NoAbort |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
313 |
Abort |
0 | 314 |
NoAbort: |
315 |
||
316 |
GetTempFileName $R0 |
|
317 |
!insertmacro MUI_HEADER_TEXT "Locate TTD" "Setup needs the location of Transport Tycoon Deluxe in order to continue." |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
318 |
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "CDFinder.ini" "CDFinder" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
319 |
|
0 | 320 |
ClearErrors |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
321 |
; Now, let's populate $CDDRIVE |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
322 |
ReadRegStr $R0 HKLM "SOFTWARE\Fish Technology Group\Transport Tycoon Deluxe" "HDPath" |
0 | 323 |
IfErrors NoTTD |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
324 |
StrCmp $CDDRIVE "" 0 Populated |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
325 |
StrCpy $CDDRIVE $R0 |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
326 |
Populated: |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
327 |
StrCpy $AddWinPrePopulate "Setup has detected your TTD folder. Don't change the folder. Simply press Next." |
0 | 328 |
Goto TruFinish |
329 |
NoTTD: |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
330 |
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 | 331 |
TruFinish: |
332 |
ClearErrors |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
333 |
!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 2" "State" $CDDRIVE ; TTDLX path |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
334 |
!insertmacro MUI_INSTALLOPTIONS_WRITE "CDFinder" "Field 3" "Text" $AddWinPrePopulate ; Caption |
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
335 |
DoneCD: |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
336 |
; Initialize the dialog *AFTER* we've changed the text otherwise we won't see the changes |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
337 |
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "CDFinder" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
338 |
!insertmacro MUI_INSTALLOPTIONS_SHOW |
0 | 339 |
FunctionEnd |
340 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
341 |
;---------------------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
342 |
; Custom page function when 'next' is selected for the TTDLX path |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
343 |
Function SelectCDExit |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
344 |
!insertmacro MUI_INSTALLOPTIONS_READ $CDDRIVE "CDFinder" "Field 2" "State" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
345 |
; If trg1r.grf does not exist at the path, retry with DOS version |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
346 |
IfFileExists $CDDRIVE\trg1r.grf "" DosCD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
347 |
IfFileExists $CDDRIVE\trgir.grf "" NoCD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
348 |
IfFileExists $CDDRIVE\sample.cat hasCD NoCD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
349 |
DosCD: |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
350 |
IfFileExists $CDDRIVE\TRG1.GRF "" NoCD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
351 |
IfFileExists $CDDRIVE\TRGI.GRF "" NoCD |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
352 |
IfFileExists $CDDRIVE\SAMPLE.CAT hasCD NoCD |
0 | 353 |
NoCD: |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
354 |
MessageBox MB_OK "Setup cannot continue without the Transport Tycoon Deluxe Location!" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
355 |
Abort |
0 | 356 |
hasCD: |
357 |
FunctionEnd |
|
358 |
||
6745
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
359 |
;---------------------------------------------------------------------------------- |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
360 |
; Disable the "Back" button on finish page if the installer is run on Win9x systems |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
361 |
Function DisableBack |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
362 |
Call GetWindowsVersion |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
363 |
Pop $R0 |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
364 |
StrCmp $R0 "win9x" 0 WinNT |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
365 |
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "BackEnabled" "0" |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
366 |
WinNT: |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
367 |
ClearErrors |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
368 |
FunctionEnd |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
369 |
|
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
370 |
;---------------------------------------------------------------------------------- |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
371 |
; Custom page function to show notices for running OpenTTD (only for win32 systems) |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
372 |
; We have extracted this custom page as Notice in the .onInit function |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
373 |
Function ShowWarningsPage |
6745
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
374 |
Call GetWindowsVersion |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
375 |
Pop $R0 |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
376 |
; Don't show the UNICODE notice if the installer is run on Win9x systems |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
377 |
StrCmp $R0 "win9x" 0 WinNT |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
378 |
Abort |
238ec04a86d4
(svn r9980) -Merge: Windows Installer changes in 0.5 (r9864).
rubidium
parents:
6744
diff
changeset
|
379 |
WinNT: |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
380 |
!insertmacro MUI_HEADER_TEXT "Installation Complete" "Important notices for OpenTTD usage." |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
381 |
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "notice.ini" "Notice" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
382 |
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Notice" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
383 |
ClearErrors |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
384 |
!insertmacro MUI_INSTALLOPTIONS_SHOW |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
385 |
FunctionEnd |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
386 |
|
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
387 |
;------------------------------------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
388 |
; Determine windows version, returns "win9x" if Win9x/Me or "winnt" on the stack |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
389 |
Function GetWindowsVersion |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
390 |
ClearErrors |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
391 |
StrCpy $R0 "winnt" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
392 |
|
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
393 |
ReadRegStr $R1 HKLM "SOFTWARE\MICROSOFT\WINDOWS NT\CurrentVersion" CurrentVersion |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
394 |
IfErrors 0 WinNT |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
395 |
StrCpy $R0 "win9x" |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
396 |
WinNT: |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
397 |
ClearErrors |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
398 |
Push $R0 |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
399 |
FunctionEnd |
0 | 400 |
|
401 |
Var OLDVERSION |
|
402 |
Var UninstallString |
|
403 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
404 |
;----------------------------------------------------------------------------------- |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
405 |
; NSIS Initialize function, determin if we are going to install/upgrade or uninstall |
0 | 406 |
Function .onInit |
407 |
StrCpy $SHORTCUTS "OpenTTD" |
|
408 |
||
409 |
SectionSetFlags 0 17 |
|
410 |
||
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
411 |
; Starts Setup - let's look for an older version of OpenTTD |
0 | 412 |
ReadRegDWORD $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
413 |
||
414 |
IfErrors ShowWelcomeMessage ShowUpgradeMessage |
|
415 |
ShowWelcomeMessage: |
|
416 |
ReadRegStr $R8 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "Version" |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
417 |
; In the event someone still has OpenTTD 0.1, this will detect that (that installer used a string instead of dword entry) |
0 | 418 |
IfErrors FinishCallback |
419 |
||
420 |
ShowUpgradeMessage: |
|
421 |
IntCmp ${INSTALLERVERSION} $R8 VersionsAreEqual InstallerIsOlder WelcomeToSetup |
|
422 |
WelcomeToSetup: |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
423 |
; An older version was found. Let's let the user know there's an upgrade that will take place. |
0 | 424 |
ReadRegStr $OLDVERSION HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "DisplayVersion" |
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
425 |
; Gets the older version then displays it in a message box |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
426 |
MessageBox MB_OK|MB_ICONINFORMATION \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
427 |
"Welcome to ${APPNAMEANDVERSION} Setup.$\n \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
428 |
This will allow you to upgrade from version $OLDVERSION." |
801
7b6cb481359c
(svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents:
254
diff
changeset
|
429 |
SectionSetFlags ${Section2} 0x80 ; set bit 7 |
0 | 430 |
Goto FinishCallback |
431 |
||
432 |
VersionsAreEqual: |
|
433 |
ReadRegStr $UninstallString HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenTTD" "UninstallString" |
|
434 |
IfFileExists "$UninstallString" "" FinishCallback |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
435 |
MessageBox MB_YESNO|MB_ICONQUESTION \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
436 |
"Setup detected ${APPNAMEANDVERSION} on your system. That's the version this program will install.$\n \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
437 |
Are you trying to uninstall it?" \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
438 |
IDYES DoUninstall IDNO FinishCallback |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
439 |
DoUninstall: ; You have the same version as this installer. This allows you to uninstall. |
0 | 440 |
Exec "$UninstallString" |
441 |
Quit |
|
442 |
||
443 |
InstallerIsOlder: |
|
6168
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
444 |
MessageBox MB_OK|MB_ICONSTOP \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
445 |
"You have a newer version of ${APPNAME}.$\n \ |
91640fd48876
(svn r8926) -Merge: Release changes from the 0.5 branch back to trunk. This ensures an updated changelog, readme, etc.
Darkvater
parents:
5965
diff
changeset
|
446 |
Setup will now exit." |
0 | 447 |
Quit |
448 |
||
449 |
FinishCallback: |
|
450 |
ClearErrors |
|
451 |
FunctionEnd |
|
452 |
; eof |
|
453 |