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