1 !include EnvVarUpdate.nsh
5 !define VS_REDIST_FULL "c:\Program Files (x86)\Microsoft Visual Studio ${VSVER}.0\VC\redist\1033\${VS_REDIST_EXE}"
7 ; For example can be found with regedit:
8 ; Microsoft Visual C++ 2013 x86 Minimum Runtime
9 !if "${VSARCH}" = "x64"
12 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\6E8D947A316B3EB3F8F540C548BE2AB9"
15 ; Microsoft Visual C++ 2015 x64 Minimum Runtime - 14.0.23026
16 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\51E9E3D0A7EDB003691F4BFA219B4688"
19 InstallDir "$PROGRAMFILES64\Zebra"
23 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\21EE4A31AE32173319EEFE3BD6FDFFE3"
26 ; Microsoft Visual C++ 2015 x86 Minimum Runtime - 14.0.23026
27 !define VS_REDIST_KEY "SOFTWARE\Classes\Installer\Products\55E3652ACEB38283D8765E8E9B8E6B57"
30 InstallDir "$PROGRAMFILES\Zebra"
34 !define VS_REDIST_EXE vc_redist.${VSARCH}.exe
36 !define VS_REDIST_EXE vcredist_${VSARCH}.exe
39 RequestExecutionLevel admin
44 Caption "Index Data Zebra ${VERSION} Setup"
45 OutFile "idzebra_${VERSION}.exe"
47 LicenseText "You must read the following license before installing:"
48 LicenseData license.txt
50 ComponentText "This will install Zebra on your computer:"
51 InstType "Full (w/ Source)"
52 InstType "Lite (w/o Source)"
54 InstallDirRegKey HKLM "SOFTWARE\Index Data\Zebra" ""
56 ;--------------------------------
59 !insertmacro MUI_PAGE_LICENSE "license.txt"
60 !insertmacro MUI_PAGE_COMPONENTS
61 !insertmacro MUI_PAGE_DIRECTORY
62 !insertmacro MUI_PAGE_INSTFILES
64 !insertmacro MUI_UNPAGE_CONFIRM
65 !insertmacro MUI_UNPAGE_INSTFILES
70 ; UninstPage uninstConfirm
71 ; UninstPage instfiles
73 ;--------------------------------
76 !insertmacro MUI_LANGUAGE "English"
78 ;--------------------------------
79 Section "" ; (default section)
81 ; add files / whatever that need to be installed here.
82 WriteRegStr HKLM "SOFTWARE\Index Data\Zebra" "" "$INSTDIR"
83 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "DisplayName" "Zebra ${VERSION} (remove only)"
84 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "UninstallString" '"$INSTDIR\uninst.exe"'
85 ; write out uninstaller
86 WriteUninstaller "$INSTDIR\uninst.exe"
87 SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
88 CreateShortCut "$SMPROGRAMS\Index Data\Zebra\Zebra Program Directory.lnk" \
90 WriteINIStr "$SMPROGRAMS\Index Data\Zebra\Zebra Home page.url" \
91 "InternetShortcut" "URL" "http://www.indexdata.dk/zebra/"
92 CreateShortCut "$SMPROGRAMS\Index Data\Zebra\Uninstall Zebra.lnk" \
99 SectionEnd ; end of default section
101 Section "Zebra Runtime"
103 SetOutPath $INSTDIR\bin
104 !if "${VS_REDIST_FULL}" != ""
105 File "${VS_REDIST_FULL}"
106 ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version"
108 ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart'
110 Delete "$INSTDIR\bin\${VS_REDIST_EXE}"
113 File ..\bin\idzebra.dll
114 File ..\bin\libxml2.dll
115 File ..\bin\libxslt.dll
118 File ..\bin\libexpat.dll
121 Section "Zebra Development"
123 SetOutPath $INSTDIR\include
125 SetOutPath $INSTDIR\include\idzebra
126 File ..\include\idzebra\*.h
127 SetOutPath $INSTDIR\lib
131 Section "Zebra Documentation"
133 SetOutPath $INSTDIR\doc
134 File /nonfatal /r ..\doc\*.html
138 SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
139 CreateShortCut "$SMPROGRAMS\Index Data\Zebra\HTML Documentation.lnk" \
140 "$INSTDIR\doc\index.html"
143 Section "Zebra Examples"
149 File /r /x *.mf /x *.LCK ..\examples
152 Section "Zebra Source"
156 SetOutPath $INSTDIR\util
159 SetOutPath $INSTDIR\dfa
162 SetOutPath $INSTDIR\index
165 SetOutPath $INSTDIR\isams
167 SetOutPath $INSTDIR\isamc
170 SetOutPath $INSTDIR\isamb
172 SetOutPath $INSTDIR\data1
174 SetOutPath $INSTDIR\dict
177 SetOutPath $INSTDIR\bfile
180 SetOutPath $INSTDIR\rset
182 SetOutPath $INSTDIR\test\api
184 File ..\test\api\*.cfg
185 SetOutPath $INSTDIR\win
193 ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR\bin"
196 ; begin uninstall settings/section
197 UninstallText "This will uninstall Zebra ${VERSION} from your system"
200 ; add delete commands to delete whatever files/registry keys/etc you installed here.
201 Delete "$INSTDIR\uninst.exe"
202 DeleteRegKey HKLM "SOFTWARE\Index Data\Zebra"
203 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Zebra"
204 ExecWait '"$INSTDIR\bin\zebrasrv" -remove'
205 RMDir /r "$SMPROGRAMS\Index Data\Zebra"
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."