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