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