1 ; This file is part of the YAZ toolkit.
2 ; Copyright (C) Index Data
3 ; See the file LICENSE for details.
5 !include EnvVarUpdate.nsh
10 !define VS_REDIST_FULL "c:\Program Files (x86)\Microsoft Visual Studio ${VSVER}.0\VC\redist\1033\${VS_REDIST_EXE}"
12 ; For example can be found with regedit:
13 ; Microsoft Visual C++ 2013 x86 Minimum Runtime
14 !if "${VSARCH}" = "x64"
17 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\6E8D947A316B3EB3F8F540C548BE2AB9"
20 ; Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026
21 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\51E9E3D0A7EDB003691F4BFA219B4688"
24 InstallDir "$PROGRAMFILES64\YAZ"
28 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\21EE4A31AE32173319EEFE3BD6FDFFE3"
31 ; Microsoft Visual C++ 2015 x86 Minimum Runtime - 14.0.23026
32 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\55E3652ACEB38283D8765E8E9B8E6B57"
36 !define VS_REDIST_EXE vc_redist.${VSARCH}.exe
38 !define VS_REDIST_EXE vcredist_${VSARCH}.exe
42 InstallDir "$PROGRAMFILES\YAZ"
46 RequestExecutionLevel admin
51 Caption "Index Data YAZ ${VERSION} Setup"
52 OutFile "yaz_${VERSION}.exe"
54 LicenseText "You must read the following license before installing:"
55 LicenseData license.txt
57 ComponentText "This will install the YAZ Toolkit on your computer:"
58 InstType "Full (w/ Source)"
59 InstType "Lite (w/o Source)"
61 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
64 ;----------------------------
68 !insertmacro MUI_PAGE_LICENSE "license.txt"
69 !insertmacro MUI_PAGE_COMPONENTS
70 !insertmacro MUI_PAGE_DIRECTORY
71 !insertmacro MUI_PAGE_INSTFILES
73 !insertmacro MUI_UNPAGE_CONFIRM
74 !insertmacro MUI_UNPAGE_INSTFILES
79 ; UninstPage uninstConfirm
80 ; UninstPage instfiles
82 ;--------------------------------
85 !insertmacro MUI_LANGUAGE "English"
87 ;--------------------------------
89 Section "" ; (default section)
91 ; add files / whatever that need to be installed here.
92 WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
93 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
94 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
95 ; write out uninstaller
96 WriteUninstaller "$INSTDIR\uninst.exe"
97 SetOutPath $SMPROGRAMS\YAZ
98 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
100 WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
101 "InternetShortcut" "URL" "http://www.indexdata.com/yaz/"
102 CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
103 "$INSTDIR\uninst.exe"
109 SetOutPath $INSTDIR\ztest
110 File ..\ztest\dummy-grs
111 File ..\ztest\dummy-words
112 SetOutPath $INSTDIR\etc
115 File ..\etc\pqf.properties
117 SectionEnd ; end of default section
119 Section "YAZ Runtime" YAZ_Runtime
121 SetOutPath $INSTDIR\bin
122 !if "${VS_REDIST_FULL}" != ""
123 File "${VS_REDIST_FULL}"
124 ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version"
126 ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart'
128 Delete "$INSTDIR\bin\${VS_REDIST_EXE}"
130 IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
131 ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
135 SetOutPath $SMPROGRAMS\YAZ
136 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
137 "$INSTDIR\bin\yaz-client.exe"
138 SetOutPath $SMPROGRAMS\YAZ\Server
139 CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
140 "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
141 CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
142 "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
143 CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
144 "$INSTDIR\bin\yaz-ztest.exe" '-remove'
147 Section "YAZ Development" YAZ_Development
149 SetOutPath $INSTDIR\include\yaz
150 File ..\include\yaz\*.h
151 SetOutPath $INSTDIR\lib
155 Section "YAZ Documentation" YAZ_Documentation
157 SetOutPath $INSTDIR\doc
158 File /nonfatal /r ..\doc\*.css
159 File /nonfatal /r ..\doc\*.ent
160 File /nonfatal /r ..\doc\*.html
163 File /nonfatal /r ..\doc\*.xsl
164 SetOutPath $SMPROGRAMS\YAZ
165 CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
166 "$INSTDIR\doc\index.html"
169 Section "YAZ Source" YAZ_Source
174 File /r /x yaz ..\*.h
175 SetOutPath $INSTDIR\util
176 File ..\util\yaz-asncomp
177 SetOutPath $INSTDIR\src
182 File ..\src\codetables*.xml
183 SetOutPath $INSTDIR\test
188 SetOutPath $INSTDIR\win
194 Section "YAZ4J" YAZ4J
196 SetOutPath $INSTDIR\bin
197 File /nonfatal ..\bin\yaz4j.dll
198 SetOutPath $INSTDIR\java
199 File /nonfatal ..\java\yaz4j.jar
202 Section "YAZ Path" YAZ_PATH
204 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
207 ; begin uninstall settings/section
208 UninstallText "This will uninstall YAZ ${VERSION} from your system"
211 ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
212 RMDir /r $SMPROGRAMS\YAZ
213 Delete "$INSTDIR\uninst.exe"
214 DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
215 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
217 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
218 IfFileExists $INSTDIR 0 Removed
219 MessageBox MB_OK|MB_ICONEXCLAMATION \
220 "Note: $INSTDIR could not be removed."
224 ;--------------------------------
228 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
229 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
230 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
231 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
232 LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ."
233 LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ."
235 ;Assign language strings to sections
236 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
237 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
238 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
239 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
240 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
241 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J)
242 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH)
243 !insertmacro MUI_FUNCTION_DESCRIPTION_END