acb8c402bb117feb0bc1811faca39cb56cb4e26c
[yaz-moved-to-github.git] / win / yaz.nsi
1 ; $Id: yaz.nsi,v 1.63 2005-02-25 09:36:32 adam Exp $
2
3 !define VERSION "2.0.35"
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\*.asn
141         File ..\src\codetables.xml
142         SetOutPath $INSTDIR\zoom
143         File ..\zoom\*.c
144         SetOutPath $INSTDIR\ztest
145         File ..\ztest\*.c
146         SetOutPath $INSTDIR\client
147         File ..\client\*.c
148         File ..\client\*.h
149         SetOutPath $INSTDIR\win
150         File makefile
151         File *.nsi
152         File *.rc
153         File *.h
154 SectionEnd
155
156 ; begin uninstall settings/section
157 UninstallText "This will uninstall YAZ ${VERSION} from your system"
158
159 Section Uninstall
160 ; add delete commands to delete whatever files/registry keys/etc you installed here.
161         Delete "$INSTDIR\uninst.exe"
162         DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
163         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
164         ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
165         RMDir /r $SMPROGRAMS\YAZ
166         RMDir /r $INSTDIR
167         IfFileExists $INSTDIR 0 Removed 
168                 MessageBox MB_OK|MB_ICONEXCLAMATION \
169                  "Note: $INSTDIR could not be removed."
170 Removed:
171 SectionEnd
172
173 ;--------------------------------
174 ;Descriptions
175
176   ;Language strings
177 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
178 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
179 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML and PDF. Describes both YAZ applications and the API."
180 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
181
182 ;Assign language strings to sections
183 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
184 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
185 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
186 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
187 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
188 !insertmacro MUI_FUNCTION_DESCRIPTION_END
189
190 ; eof