11; ELK (elasticsearch - logstash - kibana) windows installer nsis script
2- ; Copyright (c) 2015 Luigi Grilli
2+ ; Copyright (c) 2016 Luigi Grilli
33;
44; basic script template for NSIS installers
55;
@@ -105,6 +105,7 @@ Page license
105105!endif
106106
107107; Page components
108+ Page components
108109Page directory
109110Page instfiles
110111
@@ -175,7 +176,6 @@ Section
175176
176177 SetOutPath $INSTDIR
177178
178-
179179; package all files, recursively, preserving attributes
180180; assume files are in the correct places
181181
@@ -191,42 +191,52 @@ Section
191191 File /a "${srcdir}\${icon}"
192192!endif
193193
194- File /r "${srcdir}\*"
195-
196194 SetOutPath $INSTDIR\nssm
197-
198195 File /r "tools\nssm\*"
199196
200197 SetOutPath $INSTDIR\scripts
201-
202198 File /r "scripts\*"
203199
204- SetOutPath $INSTDIR\logstash\conf
200+ WriteUninstaller "${uninstaller}"
201+ SectionEnd
205202
206- File /r "conf\logstash\*"
207-
208- ; install elasticsearch service
209- ExecWait "$INSTDIR\elasticsearch\bin\service.bat install" $0
210- ; set service to start automatically (delayed)
211- ExecWait "sc config elasticsearch-service-x64 start=delayed-auto" $0
203+ Section "Elasticsearch"
204+ SetOutPath $INSTDIR\elasticsearch
205+ File /r "${srcdir}\elasticsearch\*"
206+
207+ ; install elasticsearch service
208+ ExecWait "$INSTDIR\elasticsearch\bin\service.bat install" $0
209+ ; set service to start automatically (delayed)
210+ ExecWait "sc config elasticsearch-service-x64 start=delayed-auto" $0
211+
212+ StrCpy $R0 "$INSTDIR"
213+ System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("INSTDIR", R0).r0'
214+ StrCpy $R0 "$INSTDIR\nssm\win64\nssm.exe"
215+ System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("NSSM", R0).r0'
216+
217+ ; start services
218+ ExecWait "net start elasticsearch-service-x64" $0
219+ SectionEnd
212220
213- StrCpy $R0 "$INSTDIR"
214- System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("INSTDIR", R0).r0'
215- StrCpy $R0 "$INSTDIR\nssm\win64\nssm.exe"
216- System::Call 'Kernel32::SetEnvironmentVariable(t, t) i("NSSM", R0).r0'
221+ Section "Logstash"
222+ SetOutPath $INSTDIR\logstash
223+ File /r "${srcdir}\logstash\*"
224+
225+ SetOutPath $INSTDIR\logstash\conf
226+ File /r "conf\logstash\*"
217227
218- ExecWait "$INSTDIR\scripts\logstash-install.bat" $0
219- ExecWait "$INSTDIR\scripts\kibana-install.bat" $0
228+ ExecWait "$INSTDIR\scripts\logstash-install.bat" $0
229+ ExecWait "net start logstash" $0
230+ SectionEnd
220231
221- ; start services
222- ExecWait "net start elasticsearch-service-x64" $0
223- ExecWait "net start logstash" $0
224- ExecWait "net start kibana" $0
232+ Section "Kibana"
233+ SetOutPath $INSTDIR\kibana
234+ File /r "${srcdir}\kibana\*"
225235
226- WriteUninstaller "${uninstaller}"
227-
236+ ExecWait "$INSTDIR\scripts\kibana-install.bat" $0
237+ ExecWait "net start kibana" $0
228238SectionEnd
229-
239+
230240; Uninstaller
231241; All section names prefixed by "Un" will be in the uninstaller
232242
0 commit comments