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"
39 Caption "Index Data YAZ ${VERSION} Setup"
40 OutFile "yaz_${VERSION}.exe"
42 LicenseText "You must read the following license before installing:"
43 LicenseData license.txt
45 ComponentText "This will install the YAZ Toolkit on your computer:"
46 InstType "Full (w/ Source)"
47 InstType "Lite (w/o Source)"
49 InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" ""
52 ;----------------------------
56 !insertmacro MUI_PAGE_LICENSE "license.txt"
57 !insertmacro MUI_PAGE_COMPONENTS
58 !insertmacro MUI_PAGE_DIRECTORY
59 !insertmacro MUI_PAGE_INSTFILES
61 !insertmacro MUI_UNPAGE_CONFIRM
62 !insertmacro MUI_UNPAGE_INSTFILES
67 ; UninstPage uninstConfirm
68 ; UninstPage instfiles
70 ;--------------------------------
73 !insertmacro MUI_LANGUAGE "English"
75 ;--------------------------------
77 Section "" ; (default section)
79 ; add files / whatever that need to be installed here.
80 WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR"
81 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)"
82 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"'
83 ; write out uninstaller
84 WriteUninstaller "$INSTDIR\uninst.exe"
85 SetOutPath $SMPROGRAMS\YAZ
86 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \
88 WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \
89 "InternetShortcut" "URL" "http://www.indexdata.com/yaz/"
90 CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \
97 SetOutPath $INSTDIR\ztest
98 File ..\ztest\dummy-grs
99 File ..\ztest\dummy-words
100 SetOutPath $INSTDIR\etc
103 File ..\etc\pqf.properties
105 SectionEnd ; end of default section
107 Section "YAZ Runtime" YAZ_Runtime
109 SetOutPath $INSTDIR\bin
110 !if "${VS_REDIST_FULL}" != ""
111 File "${VS_REDIST_FULL}"
112 ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version"
114 ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart'
116 Delete "$INSTDIR\bin\${VS_REDIST_EXE}"
118 IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice
119 ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove'
123 SetOutPath $SMPROGRAMS\YAZ
124 CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \
125 "$INSTDIR\bin\yaz-client.exe"
126 SetOutPath $SMPROGRAMS\YAZ\Server
127 CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \
128 "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"'
129 CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \
130 "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210'
131 CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \
132 "$INSTDIR\bin\yaz-ztest.exe" '-remove'
135 Section "YAZ Development" YAZ_Development
137 SetOutPath $INSTDIR\include\yaz
138 File ..\include\yaz\*.h
139 SetOutPath $INSTDIR\lib
143 Section "YAZ Documentation" YAZ_Documentation
145 SetOutPath $INSTDIR\doc
146 File /nonfatal /r ..\doc\*.css
147 File /nonfatal /r ..\doc\*.ent
148 File /nonfatal /r ..\doc\*.html
151 File /nonfatal /r ..\doc\*.xsl
152 SetOutPath $SMPROGRAMS\YAZ
153 CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \
154 "$INSTDIR\doc\index.html"
157 Section "YAZ Source" YAZ_Source
162 File /r /x yaz ..\*.h
163 SetOutPath $INSTDIR\util
164 File ..\util\yaz-asncomp
165 SetOutPath $INSTDIR\src
170 File ..\src\codetables*.xml
171 SetOutPath $INSTDIR\test
176 SetOutPath $INSTDIR\win
182 Section "YAZ4J" YAZ4J
184 SetOutPath $INSTDIR\bin
185 File /nonfatal ..\bin\yaz4j.dll
186 SetOutPath $INSTDIR\java
187 File /nonfatal ..\java\yaz4j.jar
190 Section "YAZ Path" YAZ_PATH
192 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
195 ; begin uninstall settings/section
196 UninstallText "This will uninstall YAZ ${VERSION} from your system"
199 ; add delete commands to delete whatever files/registry keys/etc you installed here.
200 Delete "$INSTDIR\uninst.exe"
201 DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ"
202 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ"
203 ExecWait '"$INSTDIR\bin\yaz-ztest" -remove'
204 RMDir /r $SMPROGRAMS\YAZ
206 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\bin"
207 IfFileExists $INSTDIR 0 Removed
208 MessageBox MB_OK|MB_ICONEXCLAMATION \
209 "Note: $INSTDIR could not be removed."
213 ;--------------------------------
217 LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs."
218 LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ."
219 LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API."
220 LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)."
221 LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ."
222 LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ."
224 ;Assign language strings to sections
225 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
226 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime)
227 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development)
228 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation)
229 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source)
230 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J)
231 !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH)
232 !insertmacro MUI_FUNCTION_DESCRIPTION_END