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_EXE vcredist_${VSARCH}.exe
11 !define VS_REDIST_FULL "c:\Program Files (x86)\Microsoft Visual Studio ${VSVER}.0\VC\redist\1033\${VS_REDIST_EXE}"
13 ; For example can be found with regedit:
14 ; Microsoft Visual C++ 2013 x86 Minimum Runtime
15 !if "${VSARCH}" = "x64"
18 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\6E8D947A316B3EB3F8F540C548BE2AB9"
23 InstallDir "$PROGRAMFILES64\YAZ"
27 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\21EE4A31AE32173319EEFE3BD6FDFFE3"
32 InstallDir "$PROGRAMFILES\YAZ"
36 RequestExecutionLevel admin
41 Caption "Index Data YAZ ${VERSION} Setup"
42 OutFile "yaz_${VERSION}.exe"
44 LicenseText "You must read the following license before installing:"
45 LicenseData license.txt
47 ComponentText "This will install the YAZ Toolkit on your computer:"
48 InstType "Full (w/ Source)"
49 InstType "Lite (w/o Source)"
51 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
54 ;----------------------------
58 !insertmacro MUI_PAGE_LICENSE "license.txt"
59 !insertmacro MUI_PAGE_COMPONENTS
60 !insertmacro MUI_PAGE_DIRECTORY
61 !insertmacro MUI_PAGE_INSTFILES
63 !insertmacro MUI_UNPAGE_CONFIRM
64 !insertmacro MUI_UNPAGE_INSTFILES
69 ; UninstPage uninstConfirm
70 ; UninstPage instfiles
72 ;--------------------------------
75 !insertmacro MUI_LANGUAGE "English"
77 ;--------------------------------
79 Section "" ; (default section)
81 ; add files / whatever that need to be installed here.
82 WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
83 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
84 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
85 ; write out uninstaller
86 WriteUninstaller "$INSTDIR\uninst.exe"
87 SetOutPath $SMPROGRAMS\YAZ
88 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
90 WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
91 "InternetShortcut" "URL" "http://www.indexdata.com/yaz/"
92 CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
99 SetOutPath $INSTDIR\ztest
100 File ..\ztest\dummy-grs
101 File ..\ztest\dummy-words
102 SetOutPath $INSTDIR\etc
105 File ..\etc\pqf.properties
107 SectionEnd ; end of default section
109 Section "YAZ Runtime" YAZ_Runtime
111 SetOutPath $INSTDIR\bin
112 !if "${VS_REDIST_FULL}" != ""
113 File "${VS_REDIST_FULL}"
114 ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version"
116 ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart'
118 Delete "$INSTDIR\bin\${VS_REDIST_EXE}"
120 IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
121 ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
125 SetOutPath $SMPROGRAMS\YAZ
126 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
127 "$INSTDIR\bin\yaz-client.exe"
128 SetOutPath $SMPROGRAMS\YAZ\Server
129 CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
130 "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
131 CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
132 "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
133 CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
134 "$INSTDIR\bin\yaz-ztest.exe" '-remove'
137 Section "YAZ Development" YAZ_Development
139 SetOutPath $INSTDIR\include\yaz
140 File ..\include\yaz\*.h
141 SetOutPath $INSTDIR\lib
145 Section "YAZ Documentation" YAZ_Documentation
147 SetOutPath $INSTDIR\doc
148 File /nonfatal /r ..\doc\*.css
149 File /nonfatal /r ..\doc\*.ent
150 File /nonfatal /r ..\doc\*.html
153 File /nonfatal /r ..\doc\*.xsl
154 SetOutPath $SMPROGRAMS\YAZ
155 CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
156 "$INSTDIR\doc\index.html"
159 Section "YAZ Source" YAZ_Source
164 File /r /x yaz ..\*.h
165 SetOutPath $INSTDIR\util
166 File ..\util\yaz-asncomp
167 SetOutPath $INSTDIR\src
172 File ..\src\codetables*.xml
173 SetOutPath $INSTDIR\test
178 SetOutPath $INSTDIR\win
184 Section "YAZ4J" YAZ4J
186 SetOutPath $INSTDIR\bin
187 File /nonfatal ..\bin\yaz4j.dll
188 SetOutPath $INSTDIR\java
189 File /nonfatal ..\java\yaz4j.jar
192 Section "YAZ Path" YAZ_PATH
194 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
197 ; begin uninstall settings/section
198 UninstallText "This will uninstall YAZ ${VERSION} from your system"
201 ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
202 RMDir /r $SMPROGRAMS\YAZ
203 Delete "$INSTDIR\uninst.exe"
204 DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
205 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
207 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
208 IfFileExists $INSTDIR 0 Removed
209 MessageBox MB_OK|MB_ICONEXCLAMATION \
210 "Note: $INSTDIR could not be removed."
214 ;--------------------------------
218 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
219 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
220 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
221 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
222 LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ."
223 LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ."
225 ;Assign language strings to sections
226 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
227 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
228 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
229 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
230 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
231 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J)
232 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH)
233 !insertmacro MUI_FUNCTION_DESCRIPTION_END