-
Notifications
You must be signed in to change notification settings - Fork 37
/
TradeLinkSuite.nsi
436 lines (338 loc) · 16.3 KB
/
TradeLinkSuite.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
; The name of the installer
Name "TradeLinkSuite"
XPStyle on
CRCCheck force
ShowInstDetails hide
SetOverWrite on
Icon "Install\tradelinkinstaller.ico"
!define SHORT_APP_NAME "TradeLink"
!define SUPPORT_EMAIL "[email protected]"
!addplugindir Install
!include "Install\DotNET.nsh"
!include "Install\Registry.nsh"
!include "Install\FileAssociation.nsh"
; The file to write
OutFile "TradeLinkSuite.exe"
; The default installation directory
InstallDir $PROGRAMFILES\TradeLink\
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
;InstallDirRegKey HKLM "Software\TradeLinkSuite" "Install_Dir"
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
CompletedText "For additional documentation, see http://tradelink.googlecode.com"
; The stuff to install
Section "TradeLinkSuite"
SectionIn RO
!insertmacro CheckDotNET
; Set output path to the installation directory.
SetOutPath $INSTDIR
DetailPrint "Installing version ${PVERSION}..."
; remove existing shortcuts and recreate
Delete "$SMPROGRAMS\TradeLink\*.*"
Delete "$SMPROGRAMS\TradeLink Connectors\*.*"
RMDir "$SMPROGRAMS\TradeLink"
RMDir "$SMPROGRAMS\TradeLink Connectors"
CreateDirectory "$SMPROGRAMS\TradeLink"
CreateShortCut "$SMPROGRAMS\TradeLink\Asp.lnk" "$INSTDIR\ASP.exe" "" "$INSTDIR\ASP.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Quotopia.lnk" "$INSTDIR\Quotopia.exe" "" "$INSTDIR\Quotopia.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Gauntlet.lnk" "$INSTDIR\Gauntlet.exe" "" "$INSTDIR\Gauntlet.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Chartographer.lnk" "$INSTDIR\Chartographer.exe" "" "$INSTDIR\Chartographer.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Replay.lnk" "$INSTDIR\Replay.exe" "" "$INSTDIR\Replay.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Time and Sales.lnk" "$INSTDIR\TimeSales.exe" "" "$INSTDIR\TimeSales.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Uninstall TradeLink.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\TikConverter.lnk" "$INSTDIR\TikConverter.exe" "" "$INSTDIR\TikConverter.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink\TickData.lnk" "$LOCALAPPDATA\TradeLinkTicks\" "" "" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Logs.lnk" "$LOCALAPPDATA\" "" "$LOCALAPPDATA\" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Kadina.lnk" "$INSTDIR\Kadina.EXE" "" "$INSTDIR\Kadina.EXE" 0
CreateShortCut "$SMPROGRAMS\TradeLink\Record.lnk" "$INSTDIR\Record.EXE" "" "$INSTDIR\Record.EXE" 0
CreateDirectory "$SMPROGRAMS\TradeLink Connectors"
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\HoldBros-GrayBox.lnk" "$INSTDIR\GbTLServer.exe" "" "$INSTDIR\GbTLServer.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\SterlingPro.lnk" "$INSTDIR\SterServer.EXE" "" "$INSTDIR\SterServer.EXE" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\TDAmeritrade.lnk" "$INSTDIR\TDServer.EXE" "" "$INSTDIR\TDServer.EXE" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\TDAmeritradeX.lnk" "$INSTDIR\TDServerX.EXE" "" "$INSTDIR\TDServerX.EXE" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\MBTrading.lnk" "$INSTDIR\ServerMB.EXE" "" "$INSTDIR\ServerMB.EXE" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\Esignal.lnk" "$INSTDIR\ServerEsignal.exe" "" "$INSTDIR\ServerEsignal.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\DBFX.lnk" "$INSTDIR\ServerDBFX.exe" "" "$INSTDIR\ServerDBFX.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\Blackwood.lnk" "$INSTDIR\ServerBlackwood.exe" "" "$INSTDIR\ServerBlackwood.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\REDI.lnk" "$INSTDIR\ServerRedi.exe" "" "$INSTDIR\ServerRedi.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\IQFeed.lnk" "$INSTDIR\IQFeedBroker.exe" "" "$INSTDIR\IQFeedBroker.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\NxCore32.lnk" "$INSTDIR\ServerNxCore32.exe" "" "$INSTDIR\ServerNxCore32.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\NxCore64.lnk" "$INSTDIR\ServerNxCore64.exe" "" "$INSTDIR\tradelinkinstaller.ico" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\RealTick.lnk" "$INSTDIR\RealTickConnector.exe" "" "$INSTDIR\RealTickConnector.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\DAS.lnk" "$INSTDIR\ServerDAS.exe" "" "$INSTDIR\ServerDAS.exe" 0
CreateShortCut "$SMPROGRAMS\TradeLink Connectors\Rithmic.lnk" "$INSTDIR\ServerRithmic.exe" "" "$INSTDIR\ServerRithmic.exe" 0
; install these files
File "VERSION.txt"
File "Kadina\bin\release\Kadina.exe"
File "Replay\bin\release\Replay.exe"
File "ServerSterling\bin\x86\release\SterServer.exe"
File "ServerSterling\bin\x86\release\Interop.SterlingLib.dll"
File "ServerRithmic\bin\release\ServerRithmic.exe"
File "ServerRithmic\bin\release\ServerRithmic.exe.config"
File "ServerRithmic\bin\release\rapi.dll"
File "ServerRithmic\bin\release\RithmicCertificate.pk12"
File "Install\tradelinkinstaller.ico"
File "Responses\TA-Lib-Core.dll"
File "Responses\bin\release\Responses.dll"
File "Quotopia\bin\release\Quotopia.exe"
File "Quotopia\bin\release\Multimedia.dll"
File "TradeLinkCommon\bin\release\TradeLinkCommon.dll"
File "TradeLinkCommon\bin\release\TradeLinkCommon.pdb"
File "TradeLinkCommon\bin\Release\TradeLinkCommon.XML"
File "TradeLinkAppKit\bin\release\Ionic.zip.dll"
File "TradeLinkAppKit\bin\release\TradeLinkAppKit.dll"
File "TradeLinkAppKit\bin\release\TradeLinkAppKit.pdb"
File "TradeLinkAppKit\bin\Release\TradeLinkAppKit.XML"
File "TradeLinkApi\bin\release\TradeLinkApi.dll"
File "TradeLinkApi\bin\release\TradeLinkApi.pdb"
File "TradeLinkApi\bin\Release\TradeLinkAPI.XML"
File "Gauntlet\bin\release\Gauntlet.exe"
File "Gauntlet\bin\release\EarlyClose.csv"
File "Chartographer\bin\release\Chartographer.exe"
File "TimeAndSales\bin\release\TimeSales.exe"
File "ASP\bin\release\ASP.exe"
File "TradeLinkResearch\bin\release\TradeLinkResearch.dll"
File "TradeLinkResearch\bin\release\TradeLinkResearch.pdb"
File "TradeLinkResearch\bin\Release\TradeLinkResearch.XML"
File "Record\bin\release\Record.exe"
File "ServerMB\bin\x86\release\ServerMB.exe"
File "ServerMB\bin\x86\release\Interop.MBTCOMLib.dll"
File "ServerMB\bin\x86\release\Interop.MBTHISTLib.dll"
File "ServerMB\bin\x86\release\Interop.MBTORDERSLib.dll"
File "ServerMB\bin\x86\release\Interop.MBTQUOTELib.dll"
File "Install\VCRedistInstall.exe"
File "Install\TickDataInstall.exe"
File "Install\TickDataMigrate.exe"
File /nonfatal "ServerEsignal\bin\release\Interop.IESignal.dll"
File "ServerGrayBox\bin\release\GbTLServer.exe"
File "ServerGrayBox\bin\release\GBAPILibrary.dll"
File "ServerGrayBox\bin\release\Interop.GBXCTRLLib.dll"
File "ServerGrayBox\bin\release\Interop.GBQUOTESLib.dll"
File "ServerDAS\bin\release\ServerDAS.exe"
File "ServerDAS\bin\release\daslibrary.dll"
File "ServerDAS\bin\release\Imass.EventPool.dll"
File "ServerDBFX\bin\release\ServerDBFX.exe"
File "ServerDBFX\bin\release\Interop.FXCore.dll"
File "ServerBlackwood\bin\release\ServerBlackwood.exe"
File "ServerBlackwood\bin\release\Blackwood.Framework.dll"
File "ServerBlackwood\bin\release\BWCMessageLib.dll"
File "ServerBlackwood\bin\release\zlib.net.dll"
File "ServerRedi\bin\release\ServerRedi.exe"
File "ServerRedi\bin\release\Interop.RediLib.dll"
File "ServerRedi\bin\release\VBRediClasses.dll"
File "ServerRealTick\bin\release\RealTickConnector.exe"
File "ServerRealTick\dll\*"
File "ServerNxCore\dll\NxCoreAPI64.dll"
File "ServerNxCore64\bin\x64\release\ServerNxCore64.exe"
File "ServerNxCore\bin\x86\release\ServerNxCore32.exe"
File "ServerNxCore\dll\NxCoreAPI.dll"
File "TikConverter\bin\release\TikConverter.exe"
; this installer not present by default
File /nonfatal "Install\Install-Glean.exe"
; may fail if you don't have 3rd party vendor software installed
File /nonfatal "ServerEsignal\bin\release\ServerEsignal.exe"
File /nonfatal "ServerIQ-DTN\bin\Release\IQFeedBroker.exe"
File /nonfatal "ServerTD\bin\release\TDServer.exe"
File /nonfatal "ServerTD\bin\release\Interop.MSXML2.dll"
File /nonfatal "Install\libcurl.dll"
File /nonfatal "Install\LibCurlNet.dll"
File /nonfatal "Install\LibCurlShim.dll"
File /nonfatal "ServerTD\bin\release\NZipLib.dll"
File /nonfatal "ServerTDX\bin\release\TDServerX.exe"
File /nonfatal "ServerTDX\bin\release\AxInterop.tdaactx.dll"
File /nonfatal "ServerTDX\bin\release\Interop.tdaactx.dll"
File /nonfatal "ServerTDX\bin\release\Interop.MSXML2.dll"
File /nonfatal "ServerTDX\bin\release\Interop.MSXML2.dll"
File /nonfatal "ServerTDX\ActiveXComp\ActiveX\TDAACTX.ocx"
RegDLL "$INSTDIR\TDAACTX.ocx"
; don't overwrite config files files
SetOverWrite off
File "ServerNxCore\bin\x86\release\ServerNxCore32.exe.config"
File "ServerNxCore64\bin\x64\release\ServerNxCore64.exe.config"
File "ServerRedi\bin\release\ServerRedi.exe.config"
File "ServerDAS\bin\release\ServerDAS.exe.config"
File "Kadina\bin\release\Kadina.exe.config"
File "ServerSterling\bin\x86\release\SterServer.exe.config"
File "Replay\bin\release\Replay.exe.config"
File "Quotopia\bin\release\Quotopia.exe.config"
File "Gauntlet\bin\release\Gauntlet.exe.config"
File "Chartographer\bin\release\Chartographer.exe.config"
File "TimeAndSales\bin\release\TimeSales.exe.config"
File "ASP\bin\release\ASP.exe.config"
File "Record\bin\release\Record.exe.config"
File "ServerMB\bin\x86\release\ServerMB.exe.config"
; these may fail if you do not have 3rd party vendor software installed
File /nonfatal "ServerIQ-DTN\bin\Release\IQFeedBroker.exe.config"
File "ServerDBFX\bin\release\ServerDBFX.exe.config"
File "ServerBlackwood\bin\release\ServerBlackwood.exe.config"
File /nonfatal "ServerTD\bin\release\TDServer.exe.config"
File /nonfatal "ServerTDX\bin\release\TDServerX.exe.config"
File /nonfatal "ServerEsignal\bin\release\ServerEsignal.exe.config"
; done writing config files
SetOverWrite on
; removing brokerserver folder as people transition to single installer
Delete "$PROGRAMFILES\TradeLink\BrokerServer\*.*"
RMDir /r "$PROGRAMFILES\TradeLink\BrokerServer"
Delete "$PROGRAMFILES\TradeLink\TradeLinkSuite\*.*"
RMDir /r "$PROGRAMFILES\TradeLink\TradeLinkSuite"
; Write the installation path into the registry
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "Install_Dir" "$INSTDIR"
; make sure TickData folder is present
CreateDirectory "$LOCALAPPDATA\TradeLinkTicks"
; check for .net35
File "Install\DotNetInstaller.exe"
DetailPrint "Checking for .net35..."
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "InstalledDOTNET35"
StrCmp $0 "Yes" dotnetinstalled
Call IsNetfx35Installed
dotnetinstalled:
; skip tickdata and vcredistuble installs if running in silent mode
;StrCmp $SILENT "YES" finishinstall
finishinstall:
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "DisplayName" "TradeLinkSuite"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "Path" "$INSTDIR\"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "Version" "${PVERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "NoRepair" 1
WriteUninstaller "uninstall.exe"
; register tik extension
${registerExtension} "$INSTDIR\TimeSales.exe" ".tik" "TradeLink TickData"
; don't do these things on silent
StrCmp $SILENT "YES" final
ExecShell "open" "http://www.pracplay.com/landings/afterinstallingtradelink"
; install glean if present
ExecWait "Install-Glean.exe /S"
final:
SectionEnd
;--------------------------------
!if $%INCLUDEBS% == "BS"
!define VERSION "{PVERSION}"
!include "_servers.nsh"
!else
!endif
; Uninstaller
Section "TikData Samples"
DetailPrint "Checking for TickData..."
;ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "InstalledTickData"
;StrCmp $0 "Yes" finishtickdata
; change to tick data folder
SetOutPath "$LOCALAPPDATA\TradeLinkTicks"
File "TikData\*.TIK"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "InstalledTickData" "Yes"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "TickDataPath" "$LOCALAPPDATA\TradeLinkTicks"
; change back to tradelink folder
SetOutPath $INSTDIR
finishtickdata:
DetailPrint "TickData was installed."
SectionEnd
Section "ResponseExamples"
File /r /x *.user /x *.xml /x *.dll /x *.pdf /x *.csv /x *.txt /x *.Cache /x .svn /x obj /x bin Responses
File /r Responses\TA*.*
CreateShortCut "$SMPROGRAMS\TradeLink\ResponseExamples.lnk" "$INSTDIR\Responses\Responses.csproj" "" "$INSTDIR\Responses\Responses.csproj" 0
CopyFiles /silent $INSTDIR\TradeLink*.dll $INSTDIR\Responses\bin\debug
CopyFiles /silent $INSTDIR\TradeLink*.dll $INSTDIR\Responses\bin\release
SectionEnd
Section "TA-Lib Excel Example and Plugins"
File /r "Install\talib_excel"
SectionEnd
Section "Anonymous Suite Usage Tracking"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite" "TrackUsage" "Yes"
finishinstall:
SectionEnd
Section "Uninstall"
; unregister com components
UnRegDLL "$INSTDIR\TDAACTX.ocx"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TradeLinkSuite"
DeleteRegKey HKLM SOFTWARE\TradeLinkSuite
; unregister tickdata
${unregisterExtension} ".tik" "TradeLink TickData"
; uninstall glean
ExecWait "$PROGRAMFILES\Glean\uninstall.exe /S"
; Remove files and uninstaller
Delete $INSTDIR\TradeLinkSuite.nsi
Delete $INSTDIR\uninstall.exe
Delete "$INSTDIR\*.*"
Delete "$INSTDIR\Properties\*.*"
RMDir "$INSTDIR\Properties"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\TradeLink\*.*"
Delete "$SMPROGRAMS\TradeLink Connectors\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\TradeLink"
RMDir "$SMPROGRAMS\TradeLink Connectors"
RMDir "$INSTDIR"
SectionEnd
Function .onInit
Call IsSilent
; plugins dir should be automatically removed after installer runs
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "Install\tradelinklogo.bmp"
splash::show 3000 $PLUGINSDIR\splash
Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normally, and '-1' if some error occurred.
FunctionEnd
Function IsNetfx35Installed
;Check is Net 3.5 is install
;Push 0 for true, Pop -1 for false
${registry::Read} 'HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.5' SP $R0 $R1
${If} $R1 ==
;Push -1
ExecWait "DotNetInstaller.exe"
WriteRegStr HKLM SOFTWARE\TradeLinkSuite "InstalledDOTNET35" "Yes"
${Else}
;Push 0
DetailPrint ".net35 found"
${EndIf}
FunctionEnd
Function IsSilent
Var /GLOBAL SILENT
StrCpy $SILENT "NO"
Push $0
Push $CMDLINE
Push "/S"
Call StrStr
Pop $0
StrCpy $0 $0 3
StrCmp $0 "/S" silent
StrCmp $0 "/S " silent
StrCpy $0 0
Goto notsilent
silent: StrCpy $SILENT "YES"
notsilent: StrCpy $SILENT "NO"
FunctionEnd
Function StrStr
Exch $R1 ; st=haystack,old$R1, $R1=needle
Exch ; st=old$R1,haystack
Exch $R2 ; st=old$R1,old$R2, $R2=haystack
Push $R3
Push $R4
Push $R5
StrLen $R3 $R1
StrCpy $R4 0
; $R1=needle
; $R2=haystack
; $R3=len(needle)
; $R4=cnt
; $R5=tmp
loop:
StrCpy $R5 $R2 $R3 $R4
StrCmp $R5 $R1 done
StrCmp $R5 "" done
IntOp $R4 $R4 + 1
Goto loop
done:
StrCpy $R1 $R2 "" $R4
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Exch $R1
FunctionEnd