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