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