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