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