Revert
[yaz-moved-to-github.git] / win / yaz.nsi
1 ; $Id: yaz.nsi,v 1.83 2006-05-24 12:33:22 adam Exp $
2
3 !define VERSION "2.1.19"
4 !define VS_RUNTIME_LOCATION "c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin"
5
6 !include "MUI.nsh"
7
8 SetCompressor bzip2
9
10 Name "YAZ"
11 Caption "Index Data YAZ ${VERSION} Setup"
12 OutFile "yaz_${VERSION}.exe"
13
14 LicenseText "You must read the following license before installing:"
15 LicenseData license.txt
16
17 ComponentText "This will install the YAZ Toolkit on your computer:"
18 InstType "Full (w/ Source)"
19 InstType "Lite (w/o Source)"
20
21 InstallDir "$PROGRAMFILES\YAZ"
22 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
23
24
25 ;----------------------------
26 ; Pages
27
28
29   !insertmacro MUI_PAGE_LICENSE "license.txt"
30   !insertmacro MUI_PAGE_COMPONENTS
31   !insertmacro MUI_PAGE_DIRECTORY
32   !insertmacro MUI_PAGE_INSTFILES
33   
34   !insertmacro MUI_UNPAGE_CONFIRM
35   !insertmacro MUI_UNPAGE_INSTFILES
36 ; Page components
37 ; Page directory
38 ; Page instfiles
39
40 ; UninstPage uninstConfirm
41 ; UninstPage instfiles
42
43 ;--------------------------------
44 ;Languages
45  
46 !insertmacro MUI_LANGUAGE "English"
47
48 ;--------------------------------
49
50 Section "" ; (default section)
51         SetOutPath "$INSTDIR"
52         ; add files / whatever that need to be installed here.
53         WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
54         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
55         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
56         ; write out uninstaller
57         WriteUninstaller "$INSTDIR\uninst.exe"
58         SetOutPath $SMPROGRAMS\YAZ
59         CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
60                  "$INSTDIR"
61         WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
62               "InternetShortcut" "URL" "http://www.indexdata.dk/yaz/"
63         CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
64                 "$INSTDIR\uninst.exe"
65         SetOutPath $INSTDIR
66         File LICENSE.txt
67         File ..\README
68         File ..\NEWS
69         SetOutPath $INSTDIR
70         SetOutPath $INSTDIR\ztest
71         File ..\ztest\dummy-records
72         File ..\ztest\dummy-grs
73         File ..\ztest\dummy-words
74         SetOutPath $INSTDIR\etc
75         File ..\etc\*.xml
76         File ..\etc\*.xsl
77         File ..\etc\pqf.properties
78
79 SectionEnd ; end of default section
80
81 Section "YAZ Runtime" YAZ_Runtime
82         SectionIn 1 2
83         IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
84         ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
85 Noservice:
86         SetOutPath $INSTDIR\bin
87         File "${VS_RUNTIME_LOCATION}\msvcr71.dll"
88         File ..\bin\iconv.dll
89         File ..\bin\zlib1.dll
90         File ..\bin\libxml2.dll
91         File ..\bin\libxslt.dll
92         File ..\bin\yaz.dll
93         File ..\bin\*.exe
94         SetOutPath $SMPROGRAMS\YAZ
95         CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
96                  "$INSTDIR\bin\yaz-client.exe"
97         SetOutPath $SMPROGRAMS\YAZ\Server
98         CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
99                  "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
100         CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
101                   "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
102         CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
103                  "$INSTDIR\bin\yaz-ztest.exe" '-remove'
104 SectionEnd
105
106 Section "YAZ Development" YAZ_Development
107         SectionIn 1 2
108         SetOutPath $INSTDIR\include\yaz
109         File ..\include\yaz\*.h
110         SetOutPath $INSTDIR\lib
111         File ..\lib\yaz.lib
112         File ..\lib\yazd.lib
113         SetOutPath $INSTDIR\bin
114         File ..\bin\yazd.dll
115 SectionEnd
116
117 Section "YAZ Documentation" YAZ_Documentation
118         SectionIn 1 2
119         SetOutPath $INSTDIR\doc
120         File /r ..\doc\*.css
121         File /r ..\doc\*.dcl
122         File /r ..\doc\*.dsl
123         File /r ..\doc\*.ent
124         File /r ..\doc\*.html
125         File /r ..\doc\*.xml
126         File /r ..\doc\*.png
127         File /r ..\doc\*.xsl
128         SetOutPath $SMPROGRAMS\YAZ
129         CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
130                  "$INSTDIR\doc\index.html"
131 SectionEnd
132
133 Section "YAZ Source" YAZ_Source
134         SectionIn 1
135         SetOutPath $INSTDIR
136         File /r ..\*.c
137         File /r /x yaz ..\*.h
138         SetOutPath $INSTDIR\util
139         File ..\util\yaz-asncomp
140         SetOutPath $INSTDIR\src
141         File ..\src\*.y
142         File ..\src\*.tcl
143         File ..\src\*.csv
144         File ..\src\*.asn
145         File ..\src\codetables.xml
146         SetOutPath $INSTDIR\test
147         File ..\test\marc*.*
148         File ..\test\*.sh
149         File ..\test\*.xml
150         File ..\test\*.asn
151         SetOutPath $INSTDIR\win
152         File makefile
153         File *.nsi
154         File *.rc
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. 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