Ignore generated file version.nsi.
[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 !include version.nsi
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\icu*.dll
110         File ..\bin\yaz_icu3.dll
111         File ..\bin\*.exe
112         SetOutPath $SMPROGRAMS\YAZ
113         CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
114                  "$INSTDIR\bin\yaz-client.exe"
115         SetOutPath $SMPROGRAMS\YAZ\Server
116         CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
117                  "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
118         CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
119                   "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
120         CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
121                  "$INSTDIR\bin\yaz-ztest.exe" '-remove'
122 SectionEnd
123
124 Section "YAZ Development" YAZ_Development
125         SectionIn 1 2
126         SetOutPath $INSTDIR\include\yaz
127         File ..\include\yaz\*.h
128         SetOutPath $INSTDIR\lib
129         File ..\lib\yaz3.lib
130 SectionEnd
131
132 Section "YAZ Documentation" YAZ_Documentation
133         SectionIn 1 2
134         SetOutPath $INSTDIR\doc
135         File /r ..\doc\*.css
136         File /r ..\doc\*.ent
137         File /r ..\doc\*.html
138         File /r ..\doc\*.xml
139         File /r ..\doc\*.png
140         File /r ..\doc\*.xsl
141         SetOutPath $SMPROGRAMS\YAZ
142         CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
143                  "$INSTDIR\doc\index.html"
144 SectionEnd
145
146 Section "YAZ Source" YAZ_Source
147         SectionIn 1
148         SetOutPath $INSTDIR
149         File /r ..\*.c
150         File /r /x yaz ..\*.h
151         SetOutPath $INSTDIR\util
152         File ..\util\yaz-asncomp
153         SetOutPath $INSTDIR\src
154         File ..\src\*.y
155         File ..\src\*.tcl
156         File ..\src\*.csv
157         File ..\src\*.asn
158         File ..\src\codetables.xml
159         SetOutPath $INSTDIR\test
160         File ..\test\marc*.*
161         File ..\test\*.sh
162         File ..\test\*.xml
163         File ..\test\*.asn
164         SetOutPath $INSTDIR\win
165         File makefile
166         File *.nsi
167         File *.rc
168 SectionEnd
169
170 ; begin uninstall settings/section
171 UninstallText "This will uninstall YAZ ${VERSION} from your system"
172
173 Section Uninstall
174 ; add delete commands to delete whatever files/registry keys/etc you installed here.
175         Delete "$INSTDIR\uninst.exe"
176         DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
177         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
178         ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
179         RMDir /r $SMPROGRAMS\YAZ
180         RMDir /r $INSTDIR
181         IfFileExists $INSTDIR 0 Removed 
182                 MessageBox MB_OK|MB_ICONEXCLAMATION \
183                  "Note: $INSTDIR could not be removed."
184 Removed:
185 SectionEnd
186
187 ;--------------------------------
188 ;Descriptions
189
190   ;Language strings
191 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
192 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
193 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
194 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
195
196 ;Assign language strings to sections
197 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
198 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
199 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
200 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
201 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
202 !insertmacro MUI_FUNCTION_DESCRIPTION_END
203
204 ; eof