Add runtime DLL settings for VS 2015
[yaz-moved-to-github.git] / win / yaz.nsi
1 ; This file is part of the YAZ toolkit.
2 ; Copyright (C) Index Data
3 ; See the file LICENSE for details.
4
5 !include EnvVarUpdate.nsh
6 !include version.nsi
7
8 ; Microsoft runtime CRT 
9 ; Uncomment exactly ONE of the sections below
10 ; 1: MSVC 6
11 ; !define VS_RUNTIME_DLL ""
12 ; !define VS_RUNTIME_MANIFEST ""
13
14 ; 2: VS 2003
15 ; !define VS_RUNTIME_DLL "c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\msvcr71.dll"
16 ;!define VS_RUNTIME_MANIFEST ""
17
18 ; 3: VS 2005
19 ;!define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\msvcr80.dll"
20 ;!define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\Microsoft.VC80.CRT.manifest"
21
22 ; 4: VS 2008
23 ;!define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\msvc*90.dll"
24 ;!define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest"
25
26 ; 5: VS 2013
27 ;!define VS_RUNTIME_DLL      "c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\x86\Microsoft.VC120.CRT\msvc*.dll"
28 ;!define VS_RUNTIME_MANIFEST  ""
29
30 ; 6: VS 2015
31 ;!define VS_RUNTIME_DLL      "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\x86\Microsoft.VC140.CRT\msvc*.dll"
32 ;!define VS_RUNTIME_MANIFEST  ""
33
34
35 !include "MUI.nsh"
36
37 SetCompressor bzip2
38
39 Name "YAZ"
40 Caption "Index Data YAZ ${VERSION} Setup"
41 OutFile "yaz_${VERSION}.exe"
42
43 LicenseText "You must read the following license before installing:"
44 LicenseData license.txt
45
46 ComponentText "This will install the YAZ Toolkit on your computer:"
47 InstType "Full (w/ Source)"
48 InstType "Lite (w/o Source)"
49
50 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
51
52
53 ;----------------------------
54 ; Pages
55
56
57   !insertmacro MUI_PAGE_LICENSE "license.txt"
58   !insertmacro MUI_PAGE_COMPONENTS
59   !insertmacro MUI_PAGE_DIRECTORY
60   !insertmacro MUI_PAGE_INSTFILES
61   
62   !insertmacro MUI_UNPAGE_CONFIRM
63   !insertmacro MUI_UNPAGE_INSTFILES
64 ; Page components
65 ; Page directory
66 ; Page instfiles
67
68 ; UninstPage uninstConfirm
69 ; UninstPage instfiles
70
71 ;--------------------------------
72 ;Languages
73  
74 !insertmacro MUI_LANGUAGE "English"
75
76 ;--------------------------------
77
78 Section "" ; (default section)
79         SetOutPath "$INSTDIR"
80         ; add files / whatever that need to be installed here.
81         WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
82         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
83         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
84         ; write out uninstaller
85         WriteUninstaller "$INSTDIR\uninst.exe"
86         SetOutPath $SMPROGRAMS\YAZ
87         CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
88                  "$INSTDIR"
89         WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
90               "InternetShortcut" "URL" "http://www.indexdata.com/yaz/"
91         CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
92                 "$INSTDIR\uninst.exe"
93         SetOutPath $INSTDIR
94         File LICENSE.txt
95         File ..\README
96         File ..\NEWS
97         SetOutPath $INSTDIR
98         SetOutPath $INSTDIR\ztest
99         File ..\ztest\dummy-grs
100         File ..\ztest\dummy-words
101         SetOutPath $INSTDIR\etc
102         File ..\etc\*.xml
103         File ..\etc\*.xsl
104         File ..\etc\pqf.properties
105
106 SectionEnd ; end of default section
107
108 Section "YAZ Runtime" YAZ_Runtime
109         SectionIn 1 2
110         IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
111         ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
112 Noservice:
113         SetOutPath $INSTDIR\bin
114         File "${VS_RUNTIME_DLL}"
115 !if "${VS_RUNTIME_MANIFEST}" != ""
116         File "${VS_RUNTIME_MANIFEST}"
117 !endif
118         File ..\bin\*.dll
119         File ..\bin\*.exe
120         SetOutPath $SMPROGRAMS\YAZ
121         CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
122                  "$INSTDIR\bin\yaz-client.exe"
123         SetOutPath $SMPROGRAMS\YAZ\Server
124         CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
125                  "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
126         CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
127                   "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
128         CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
129                  "$INSTDIR\bin\yaz-ztest.exe" '-remove'
130 SectionEnd
131
132 Section "YAZ Development" YAZ_Development
133         SectionIn 1 2
134         SetOutPath $INSTDIR\include\yaz
135         File ..\include\yaz\*.h
136         SetOutPath $INSTDIR\lib
137         File ..\lib\yaz*.lib
138 SectionEnd
139
140 Section "YAZ Documentation" YAZ_Documentation
141         SectionIn 1 2
142         SetOutPath $INSTDIR\doc
143         File /nonfatal /r ..\doc\*.css
144         File /nonfatal /r ..\doc\*.ent
145         File /nonfatal /r ..\doc\*.html
146         File /r ..\doc\*.xml
147         File /r ..\doc\*.png
148         File /nonfatal /r ..\doc\*.xsl
149         SetOutPath $SMPROGRAMS\YAZ
150         CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
151                  "$INSTDIR\doc\index.html"
152 SectionEnd
153
154 Section "YAZ Source" YAZ_Source
155         SectionIn 1
156         SetOutPath $INSTDIR
157         File ..\IDMETA
158         File /r ..\*.c
159         File /r /x yaz ..\*.h
160         SetOutPath $INSTDIR\util
161         File ..\util\yaz-asncomp
162         SetOutPath $INSTDIR\src
163         File ..\src\*.y
164         File ..\src\*.tcl
165         File ..\src\*.csv
166         File ..\src\*.asn
167         File ..\src\codetables*.xml
168         SetOutPath $INSTDIR\test
169         File ..\test\marc*.*
170         File ..\test\*.sh
171         File ..\test\*.xml
172         File ..\test\*.asn
173         SetOutPath $INSTDIR\win
174         File makefile
175         File *.nsi
176         File *.rc
177 SectionEnd
178
179 Section "YAZ4J" YAZ4J
180         SectionIn 1 2
181         SetOutPath $INSTDIR\bin
182         File /nonfatal ..\bin\yaz4j.dll
183         SetOutPath $INSTDIR\java
184         File /nonfatal ..\java\yaz4j.jar
185 SectionEnd
186
187 Section "YAZ Path" YAZ_PATH
188         SectionIn 1 2
189         ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
190 SectionEnd
191
192 ; begin uninstall settings/section
193 UninstallText "This will uninstall YAZ ${VERSION} from your system"
194
195 Section Uninstall
196 ; add delete commands to delete whatever files/registry keys/etc you installed here.
197         Delete "$INSTDIR\uninst.exe"
198         DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
199         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
200         ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
201         RMDir /r $SMPROGRAMS\YAZ
202         RMDir /r $INSTDIR
203         ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
204         IfFileExists $INSTDIR 0 Removed 
205                 MessageBox MB_OK|MB_ICONEXCLAMATION \
206                  "Note: $INSTDIR could not be removed."
207 Removed:
208 SectionEnd
209
210 ;--------------------------------
211 ;Descriptions
212
213   ;Language strings
214 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
215 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
216 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
217 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
218 LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ."
219 LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ."
220
221 ;Assign language strings to sections
222 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
223 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
224 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
225 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
226 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
227 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J)
228 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH)
229 !insertmacro MUI_FUNCTION_DESCRIPTION_END
230
231 ; eof