File: QuantLib.nsi

package info (click to toggle)
quantlib 0.3.13-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,964 kB
  • ctags: 11,071
  • sloc: cpp: 69,443; ansic: 21,483; sh: 8,860; makefile: 1,824; lisp: 86
file content (185 lines) | stat: -rw-r--r-- 5,690 bytes parent folder | download
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

# to be used with NSIS 2.0 and up

SetCompressor lzma

!define VER_NUMBER "0.3.13"
!define /date NOW "%Y%m%d-%H_%M"

# HEADER CONFIGURATION COMMANDS
Name "QuantLib"
Caption "QuantLib - Setup"
#do not change the name below
OutFile "..\QuantLib-${VER_NUMBER}-${NOW}.exe"

InstType "Full (w/ WinHelp Documentation)"
InstType Minimal

ComponentText "This will install QuantLib ${VER_NUMBER} on your computer"

SilentInstall normal
Icon Docs\images\favicon.ico
UninstallIcon Docs\images\favicon.ico
CRCCheck on
LicenseText "You must agree with the following license before installing:"
LicenseData License.txt
DirText "Please select a location to install QuantLib (or use the default):"
InstallDir $PROGRAMFILES\QuantLib-${VER_NUMBER}
InstallDirRegKey HKEY_LOCAL_MACHINE SOFTWARE\QuantLib-${VER_NUMBER} "Install_Dir"
AutoCloseWindow false
ShowInstDetails hide
SetDateSave on

# INSTALLATION EXECUTION COMMANDS



Section "-QuantLib"
SectionIn 1 2
# this directory must be created first, or the CreateShortCut will not work
    CreateDirectory "$SMPROGRAMS\QuantLib-${VER_NUMBER}"
    SetOutPath $INSTDIR

    # these MUST be present
    File "README.txt"
    File "LICENSE.txt"
    File "News.txt"
    File "QuantLib.dsw"
    File "QuantLib.sln"
    File "QuantLib_vc8.sln"
    File "QuantLib.dev"

    File "*.txt"
    File "*.TXT"
    File "makefile.mak"
    File "*.dsp"
    File "*.vcproj"
    File "*.nsi"

    SetOutPath  $INSTDIR\ql
    File /r "ql\*.hpp"
    File /r "ql\*.h"
    File /r "ql\*.cpp"
    File /r "ql\*.c"
    File /r "ql\makefile.mak"

    SetOutPath $INSTDIR\functions
    File /r "functions\makefile.mak"
    File /r "functions\*.cpp"
    File /r "functions\*.hpp"
    File /r "functions\*.dsp"
    File /r "functions\*.dev"
    File /r "functions\*.vcproj"

    SetOutPath $INSTDIR\test-suite
    File /r "test-suite\*.txt"
    File /r "test-suite\makefile.mak"
    File /r "test-suite\*.cpp"
    File /r "test-suite\*.hpp"
    File /r "test-suite\*.dsp"
    File /r "test-suite\*.dev"
    File /r "test-suite\*.vcproj"
    File /r "test-suite\*.bat"

    SetOutPath $INSTDIR\Examples
    File /r "Examples\*.cpp"
    File /r "Examples\*.dsp"
    File /r "Examples\*.txt"
    File /r "Examples\makefile.mak"
    File /r "Examples\*.vcproj"

    SetOutPath $INSTDIR\Docs
    File /r "Docs\*.am"
    File /r "Docs\*.bmp"
    File /r "Docs\*.cpp"
    File /r "Docs\*.css"
    File /r "Docs\*.docs"
    File /r "Docs\*.doxy"
    File /r "Docs\*.eps"
    File /r "Docs\*.html"
    File /r "Docs\*.jpg"
    File /r "Docs\*.pdf"
    File /r "Docs\*.png"
    File /r "Docs\*.tex"
    File /r "Docs\*.txt"
    File /r "Docs\makefile.mak"

    WriteRegStr HKEY_LOCAL_MACHINE \
			"Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantLib-${VER_NUMBER}" \
			"DisplayName" "QuantLib ${VER_NUMBER} (remove only)"

    WriteRegStr HKEY_LOCAL_MACHINE \
	    "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantLib-${VER_NUMBER}" \
	    "UninstallString" '"QuantLibUninstall.exe"'

    WriteRegStr HKEY_CURRENT_USER "Environment" "QL_DIR" "$INSTDIR"

    WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\QuantLib-${VER_NUMBER}" \
                "Install_Dir" "$INSTDIR"

    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\Uninstall QuantLib.lnk" \
                   "$INSTDIR\QuantLibUninstall.exe" \
                   "" "$INSTDIR\QuantLibUninstall.exe" 0

    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\README.txt.lnk" \
                   "$INSTDIR\README.txt"
    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\LICENSE.txt.lnk" \
                   "$INSTDIR\LICENSE.txt"
    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\What's new.lnk" \
                   "$INSTDIR\News.txt"

    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\QuantLib VC 6 project workspace.lnk" \
                   "$INSTDIR\QuantLib.dsw"

    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\QuantLib VC 7 project workspace.lnk" \
                   "$INSTDIR\QuantLib.sln"

    CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\QuantLib VC 8 project workspace.lnk" \
                   "$INSTDIR\QuantLib_vc8.sln"

    WriteUninstaller "QuantLibUninstall.exe"

SectionEnd

Section "WinHelp documentation"
SectionIn 1
  SetOutPath "$INSTDIR\Docs"
  File /nonfatal "Docs\QuantLib-docs-${VER_NUMBER}.chm"
  IfFileExists "$INSTDIR\Docs\QuantLib-docs-${VER_NUMBER}.chm" 0 NoWinHelpDoc
      CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\Documentation (WinHelp).lnk" \
                 "$INSTDIR\Docs\QuantLib-docs-${VER_NUMBER}.chm"
  NoWinHelpDoc:
SectionEnd

Section "Start Menu Group"
SectionIn 1 2
  SetOutPath $SMPROGRAMS\QuantLib-${VER_NUMBER}

  WriteINIStr "$SMPROGRAMS\QuantLib-${VER_NUMBER}\QuantLib Home Page.url" \
              "InternetShortcut" "URL" "http://quantlib.org/"

  CreateShortCut "$SMPROGRAMS\QuantLib-${VER_NUMBER}\QuantLib Folder.lnk" \
                 "$INSTDIR"
SectionEnd

Function .onInit
  SetOutPath $TEMP
  File /oname=spltmp.bmp "Docs\images\QL.bmp"
  splash::show 2000 $TEMP\spltmp
  Pop $0 ; $0 has '1' if the user closed the splash screen early,
         ;        '0' if everything closed normal,
         ;        '-1' if some error occured.
  Delete $TEMP\spltmp.bmp
FunctionEnd

UninstallText "This will uninstall QuantLib. Hit next to continue."


Section "Uninstall"
    DeleteRegKey HKEY_LOCAL_MACHINE \
        "Software\Microsoft\Windows\CurrentVersion\Uninstall\QuantLib-${VER_NUMBER}"
    DeleteRegKey HKEY_LOCAL_MACHINE SOFTWARE\QuantLib-${VER_NUMBER}
    DeleteRegValue HKEY_CURRENT_USER  "Environment" "QL_DIR"
    RMDir /r /REBOOTOK "$SMPROGRAMS\QuantLib-${VER_NUMBER}"
    RMDir /r /REBOOTOK "$INSTDIR"
SectionEnd