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