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