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"
35 InstallDir "$PROGRAMFILES\YAZ"
39 !define VS_REDIST_EXE vc_redist.${VSARCH}.exe
41 !define VS_REDIST_EXE vcredist_${VSARCH}.exe
44 RequestExecutionLevel admin
49 Caption "Index Data YAZ ${VERSION} Setup"
50 OutFile "yaz_${VERSION}.exe"
52 LicenseText "You must read the following license before installing:"
53 LicenseData license.txt
55 ComponentText "This will install the YAZ Toolkit on your computer:"
56 InstType "Full (w/ Source)"
57 InstType "Lite (w/o Source)"
59 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
62 ;----------------------------
66 !insertmacro MUI_PAGE_LICENSE "license.txt"
67 !insertmacro MUI_PAGE_COMPONENTS
68 !insertmacro MUI_PAGE_DIRECTORY
69 !insertmacro MUI_PAGE_INSTFILES
71 !insertmacro MUI_UNPAGE_CONFIRM
72 !insertmacro MUI_UNPAGE_INSTFILES
77 ; UninstPage uninstConfirm
78 ; UninstPage instfiles
80 ;--------------------------------
83 !insertmacro MUI_LANGUAGE "English"
85 ;--------------------------------
87 Section "" ; (default section)
89 ; add files / whatever that need to be installed here.
90 WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
91 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
92 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
93 ; write out uninstaller
94 WriteUninstaller "$INSTDIR\uninst.exe"
95 SetOutPath $SMPROGRAMS\YAZ
96 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
98 WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
99 "InternetShortcut" "URL" "http://www.indexdata.com/yaz/"
100 CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
101 "$INSTDIR\uninst.exe"
107 SetOutPath $INSTDIR\ztest
108 File ..\ztest\dummy-grs
109 File ..\ztest\dummy-words
110 SetOutPath $INSTDIR\etc
113 File ..\etc\pqf.properties
115 SectionEnd ; end of default section
117 Section "YAZ Runtime" YAZ_Runtime
119 SetOutPath $INSTDIR\bin
120 !if "${VS_REDIST_FULL}" != ""
121 File "${VS_REDIST_FULL}"
122 ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version"
124 ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart'
126 Delete "$INSTDIR\bin\${VS_REDIST_EXE}"
128 IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
129 ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
133 SetOutPath $SMPROGRAMS\YAZ
134 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
135 "$INSTDIR\bin\yaz-client.exe"
136 SetOutPath $SMPROGRAMS\YAZ\Server
137 CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
138 "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
139 CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
140 "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
141 CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
142 "$INSTDIR\bin\yaz-ztest.exe" '-remove'
145 Section "YAZ Development" YAZ_Development
147 SetOutPath $INSTDIR\include\yaz
148 File ..\include\yaz\*.h
149 SetOutPath $INSTDIR\lib
153 Section "YAZ Documentation" YAZ_Documentation
155 SetOutPath $INSTDIR\doc
156 File /nonfatal /r ..\doc\*.css
157 File /nonfatal /r ..\doc\*.ent
158 File /nonfatal /r ..\doc\*.html
161 File /nonfatal /r ..\doc\*.xsl
162 SetOutPath $SMPROGRAMS\YAZ
163 CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
164 "$INSTDIR\doc\index.html"
167 Section "YAZ Source" YAZ_Source
172 File /r /x yaz ..\*.h
173 SetOutPath $INSTDIR\util
174 File ..\util\yaz-asncomp
175 SetOutPath $INSTDIR\src
180 File ..\src\codetables*.xml
181 SetOutPath $INSTDIR\test
186 SetOutPath $INSTDIR\win
192 Section "YAZ4J" YAZ4J
194 SetOutPath $INSTDIR\bin
195 File /nonfatal ..\bin\yaz4j.dll
196 SetOutPath $INSTDIR\java
197 File /nonfatal ..\java\yaz4j.jar
200 Section "YAZ Path" YAZ_PATH
202 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
205 ; begin uninstall settings/section
206 UninstallText "This will uninstall YAZ ${VERSION} from your system"
209 ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
210 RMDir /r $SMPROGRAMS\YAZ
211 Delete "$INSTDIR\uninst.exe"
212 DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
213 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
215 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
216 IfFileExists $INSTDIR 0 Removed
217 MessageBox MB_OK|MB_ICONEXCLAMATION \
218 "Note: $INSTDIR could not be removed."
222 ;--------------------------------
226 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
227 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
228 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
229 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
230 LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ."
231 LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ."
233 ;Assign language strings to sections
234 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
235 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
236 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
237 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
238 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
239 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J)
240 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH)
241 !insertmacro MUI_FUNCTION_DESCRIPTION_END