| 1 |
root |
1 |
;NSIS Setup Script for Mara.exe
|
|
|
2 |
|
|
|
3 |
!define VER_MAJOR 2003
|
|
|
4 |
!define VER_MINOR 04
|
|
|
5 |
!define NAME "Mara"
|
|
|
6 |
!define DEVELOPER "DDP"
|
|
|
7 |
|
|
|
8 |
;--------------------------------
|
|
|
9 |
;Configuration
|
|
|
10 |
|
|
|
11 |
OutFile setup_${VER_MAJOR}_${VER_MINOR}.exe
|
|
|
12 |
SetCompressor bzip2
|
|
|
13 |
|
|
|
14 |
InstType "Standard (Program Only)"
|
|
|
15 |
InstType "Data (Include Historical Data)"
|
|
|
16 |
InstType "Full (Source and historical data)"
|
|
|
17 |
|
|
|
18 |
ShowInstDetails show
|
|
|
19 |
ShowUninstDetails show
|
|
|
20 |
SetDateSave on
|
|
|
21 |
|
|
|
22 |
;---------------------------------
|
|
|
23 |
; Set the default installation directory, but then read
|
|
|
24 |
; the registory key used to maintain the last install
|
|
|
25 |
;
|
|
|
26 |
InstallDir $PROGRAMFILES\${NAME}
|
|
|
27 |
InstallDirRegKey HKLM SOFTWARE\${DEVELOPER}\${NAME} "Install_Dir"
|
|
|
28 |
|
|
|
29 |
;--------------------------------
|
|
|
30 |
!ifndef CLASSIC_UI
|
|
|
31 |
|
|
|
32 |
;Include Modern UI Macro's
|
|
|
33 |
!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
|
|
|
34 |
|
|
|
35 |
;--------------------------------
|
|
|
36 |
;Modern UI Configuration
|
|
|
37 |
|
|
|
38 |
!define MUI_PRODUCT ${NAME}
|
|
|
39 |
!define MUI_VERSION ${VER_MAJOR}_${VER_MINOR}
|
|
|
40 |
|
|
|
41 |
!define MUI_NAME "${NAME} ${MUI_VERSION}" ;Installer name
|
|
|
42 |
|
|
|
43 |
!define MUI_WELCOMEPAGE
|
|
|
44 |
!define MUI_LICENSEPAGE
|
|
|
45 |
!define MUI_COMPONENTSPAGE
|
|
|
46 |
!define MUI_COMPONENTSPAGE_SMALLDESC
|
|
|
47 |
!define MUI_DIRECTORYPAGE
|
|
|
48 |
|
|
|
49 |
; !define MUI_STARTMENUPAGE
|
|
|
50 |
!define MUI_STARTMENUPAGE_VARIABLE ${NAME}
|
|
|
51 |
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
|
|
|
52 |
!define MUI_STARTMENUPAGE_REGISTRY_KEY "SOFTWARE\${DEVELOPER}\${NAME}"
|
|
|
53 |
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start_Menu_Folder"
|
|
|
54 |
|
|
|
55 |
!define MUI_FINISHPAGE
|
|
|
56 |
;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
|
|
57 |
;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
|
|
|
58 |
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
|
|
59 |
; !define MUI_FINISHPAGE_NOAUTOCLOSE
|
|
|
60 |
|
|
|
61 |
!define MUI_ABORTWARNING
|
|
|
62 |
|
|
|
63 |
!define MUI_UNINSTALLER
|
|
|
64 |
!define MUI_UNCONFIRMPAGE
|
|
|
65 |
|
|
|
66 |
!define MUI_HEADERBITMAP "${NSISDIR}\Contrib\Icons\modern-header.bmp"
|
|
|
67 |
!define MUI_SPECIALBITMAP "${NSISDIR}\Contrib\Icons\modern-wizard nsis llama.bmp"
|
|
|
68 |
|
|
|
69 |
;--------------------------------
|
|
|
70 |
;Languages
|
|
|
71 |
|
|
|
72 |
!define MUI_TEXT_WELCOME_INFO_TEXT "This wizard will guide you through the installation of MARA. A marathon tracking program\n\n"
|
|
|
73 |
!insertmacro MUI_LANGUAGE "English"
|
|
|
74 |
|
|
|
75 |
;--------------------------------
|
|
|
76 |
;Reserve Files
|
|
|
77 |
|
|
|
78 |
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
|
|
|
79 |
!insertmacro MUI_RESERVEFILE_SPECIALINI
|
|
|
80 |
!insertmacro MUI_RESERVEFILE_SPECIALBITMAP
|
|
|
81 |
|
|
|
82 |
!endif
|
|
|
83 |
|
|
|
84 |
;--------------------------------
|
|
|
85 |
;Data
|
|
|
86 |
|
|
|
87 |
LicenseData license.txt
|
|
|
88 |
|
|
|
89 |
;--------------------------------
|
|
|
90 |
;Installer Sections
|
|
|
91 |
|
|
|
92 |
!define SF_SELECTED 1
|
|
|
93 |
|
|
|
94 |
Section "Mara Program (required)" SecCore
|
|
|
95 |
SectionIn 1 2 3 RO
|
|
|
96 |
SetOutPath $INSTDIR
|
|
|
97 |
RMDir /r $SMPROGRAMS\NSIS
|
|
|
98 |
|
|
|
99 |
SetOverwrite on
|
|
|
100 |
File mara.exe
|
|
|
101 |
File MARA_OLD.EXE
|
|
|
102 |
File mara.ico
|
|
|
103 |
File getx07.exe
|
|
|
104 |
File license.txt
|
|
|
105 |
SectionEnd
|
|
|
106 |
|
|
|
107 |
SubSection /e "Historical Data" SecData
|
|
|
108 |
Section "2001" SecData2001Base
|
|
|
109 |
SectionIn 2 3
|
|
|
110 |
SetOutPath $INSTDIR
|
|
|
111 |
File brmr2001.dat
|
|
|
112 |
File brmr2001.csv
|
|
|
113 |
File brmr2001.cnf
|
|
|
114 |
SectionEnd
|
|
|
115 |
|
|
|
116 |
SubSection "2002" SecData2002
|
|
|
117 |
Section "2002" SecData2002Base
|
|
|
118 |
SectionIn 2 3
|
|
|
119 |
SetOutPath $INSTDIR
|
|
|
120 |
File brmr2002.dat
|
|
|
121 |
File brmr2002.csv
|
|
|
122 |
File brmr2002.cnf
|
|
|
123 |
SectionEnd
|
|
|
124 |
|
|
|
125 |
Section "2002 Text" SecData2002Text
|
|
|
126 |
SectionIn 2 3
|
|
|
127 |
SetOutPath $INSTDIR
|
|
|
128 |
File /nonfatal brmr2002*.txt
|
|
|
129 |
SectionEnd
|
|
|
130 |
|
|
|
131 |
Section "2002 HTML" SecData2002Html
|
|
|
132 |
SectionIn 2 3
|
|
|
133 |
SetOutPath $INSTDIR
|
|
|
134 |
File brmr2002*.html
|
|
|
135 |
SectionEnd
|
|
|
136 |
SubSectionEnd
|
|
|
137 |
|
|
|
138 |
SubSectionEnd
|
|
|
139 |
|
|
|
140 |
Section "Full Source Code" SecCode
|
|
|
141 |
SectionIn 3
|
|
|
142 |
SetOutPath $INSTDIR
|
|
|
143 |
File *.c
|
|
|
144 |
File *.h
|
|
|
145 |
File makefile
|
|
|
146 |
File *.bas
|
|
|
147 |
File *.nsi
|
|
|
148 |
|
|
|
149 |
SectionEnd
|
|
|
150 |
|
|
|
151 |
Section "Desktop Shortcuts" SecIcons
|
|
|
152 |
SectionIn 1 2 3
|
|
|
153 |
SetOutPath $INSTDIR
|
|
|
154 |
|
|
|
155 |
CreateShortCut "$DESKTOP\Mara.lnk" "$INSTDIR\mara.exe" "brmr" "$INSTDIR\mara.ico"
|
|
|
156 |
|
|
|
157 |
SectionEnd
|
|
|
158 |
|
|
|
159 |
Section "Start Menu Entry" SecStartMenu
|
|
|
160 |
SectionIn 1 2 3
|
|
|
161 |
!insertmacro MUI_STARTMENU_WRITE_BEGIN
|
|
|
162 |
|
|
|
163 |
;Create shortcuts
|
|
|
164 |
CreateDirectory "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}"
|
|
|
165 |
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\Mara.lnk" "$INSTDIR\mara.exe" "brmr" "$INSTDIR\mara.ico"
|
|
|
166 |
CreateShortCut "$SMPROGRAMS\${MUI_STARTMENUPAGE_VARIABLE}\UnInstall.lnk" "$INSTDIR\uninstall.exe"
|
|
|
167 |
|
|
|
168 |
!insertmacro MUI_STARTMENU_WRITE_END
|
|
|
169 |
SectionEnd
|
|
|
170 |
|
|
|
171 |
Section -post
|
|
|
172 |
|
|
|
173 |
; Write the installation path into the registry
|
|
|
174 |
WriteRegStr HKLM SOFTWARE\${DEVELOPER}\${NAME} "Install_Dir" "$INSTDIR"
|
|
|
175 |
WriteRegStr HKLM SOFTWARE\${DEVELOPER}\${NAME} "Install_Version" "${VER_MAJOR}_${VER_MINOR}"
|
|
|
176 |
|
|
|
177 |
; Write the uninstall keys for Windows
|
|
|
178 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayName" "Mara Program (remove only)"
|
|
|
179 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
180 |
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}" "DisplayIcon" '"$INSTDIR\mara.ico"'
|
|
|
181 |
|
|
|
182 |
; Write the uninstaller
|
|
|
183 |
WriteUninstaller "uninstall.exe"
|
|
|
184 |
|
|
|
185 |
SectionEnd
|
|
|
186 |
|
|
|
187 |
;--------------------------------
|
|
|
188 |
;Descriptions
|
|
|
189 |
|
|
|
190 |
!ifndef CLASSIC_UI
|
|
|
191 |
|
|
|
192 |
!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
|
|
|
193 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core files required to use Mara"
|
|
|
194 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData} "Data from past events"
|
|
|
195 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData2001Base} "Basic data files from 2001"
|
|
|
196 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData2002} "Data and Reports for 2002"
|
|
|
197 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData2002Base} "Basic data files from 2002"
|
|
|
198 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData2002Text} "Text reports from 2002"
|
|
|
199 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecData2002Html} "HTML reports from 2002"
|
|
|
200 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecCode} "Source Code for the Mara Program"
|
|
|
201 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecIcons} "Desktop Shortcut"
|
|
|
202 |
!insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} "Start Menu Entry"
|
|
|
203 |
!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
|
|
|
204 |
|
|
|
205 |
!endif
|
|
|
206 |
|
|
|
207 |
;--------------------------------
|
|
|
208 |
;Uninstaller Section
|
|
|
209 |
|
|
|
210 |
Section Uninstall
|
|
|
211 |
|
|
|
212 |
; Delete the entire directory
|
|
|
213 |
RMDir /r $INSTDIR
|
|
|
214 |
|
|
|
215 |
; Delete the desktop shortcut
|
|
|
216 |
Delete "$DESKTOP\Mara.lnk"
|
|
|
217 |
|
|
|
218 |
; Delete the StartMenu entry
|
|
|
219 |
ReadRegStr $R0 "${MUI_STARTMENUPAGE_REGISTRY_ROOT}" "${MUI_STARTMENUPAGE_REGISTRY_KEY}" "${MUI_STARTMENUPAGE_REGISTRY_VALUENAME}"
|
|
|
220 |
StrCmp $R0 "" noshortcuts
|
|
|
221 |
|
|
|
222 |
Delete "$SMPROGRAMS\$R0\Mara.lnk"
|
|
|
223 |
Delete "$SMPROGRAMS\$R0\uninstall.lnk"
|
|
|
224 |
RMDir "$SMPROGRAMS\$R0" ;Only if empty, so it won't delete other shortcuts
|
|
|
225 |
|
|
|
226 |
noshortcuts:
|
|
|
227 |
|
|
|
228 |
; Delete the registery data
|
|
|
229 |
DeleteRegKey HKLM SOFTWARE\${DEVELOPER}\${NAME}
|
|
|
230 |
DeleteRegKey /ifempty HKLM SOFTWARE\${DEVELOPER}
|
|
|
231 |
|
|
|
232 |
!ifndef CLASSIC_UI
|
|
|
233 |
;Modern UI Finish Header
|
|
|
234 |
!insertmacro MUI_UNFINISHHEADER
|
|
|
235 |
!endif
|
|
|
236 |
|
|
|
237 |
SectionEnd
|