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