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