Bundle with Visual Studio 8 CRT by default
[idzebra-moved-to-github.git] / win / zebra.nsi
1 ; $Id: zebra.nsi,v 1.29 2006-06-07 11:20:03 adam Exp $
2
3 !define VERSION "1.4.0"
4
5 ; Microsoft runtime CRT
6 ; VS 2003
7 ; !define VS_RUNTIME "c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\msvcr71.dll"
8
9 ; VS 2005
10 !define VS_RUNTIME "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\msvcr80.dll"
11
12 !include "MUI.nsh"
13
14 SetCompressor bzip2
15
16 Name "Zebra"
17 Caption "Index Data Zebra ${VERSION} Setup"
18 OutFile "idzebra_${VERSION}.exe"
19
20 LicenseText "You must read the following license before installing:"
21 LicenseData license.txt
22
23 ComponentText "This will install Zebra on your computer:"
24 InstType "Full (w/ Source)"
25 InstType "Lite (w/o Source)"
26
27 InstallDir "$PROGRAMFILES\Zebra"
28 InstallDirRegKey HKLM "SOFTWARE\Index Data\Zebra" ""
29
30 ;--------------------------------
31 ; Pages
32
33   !insertmacro MUI_PAGE_LICENSE "license.txt"
34   !insertmacro MUI_PAGE_COMPONENTS
35   !insertmacro MUI_PAGE_DIRECTORY
36   !insertmacro MUI_PAGE_INSTFILES
37   
38   !insertmacro MUI_UNPAGE_CONFIRM
39   !insertmacro MUI_UNPAGE_INSTFILES
40 ; Page components
41 ; Page directory
42 ; Page instfiles
43
44 ; UninstPage uninstConfirm
45 ; UninstPage instfiles
46
47 ;--------------------------------
48 ;Languages
49  
50 !insertmacro MUI_LANGUAGE "English"
51
52 ;--------------------------------
53 Section "" ; (default section)
54         SetOutPath "$INSTDIR"
55         ; add files / whatever that need to be installed here.
56         WriteRegStr HKLM "SOFTWARE\Index Data\Zebra" "" "$INSTDIR"
57         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "DisplayName" "Zebra ${VERSION} (remove only)"
58         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "UninstallString" '"$INSTDIR\uninst.exe"'
59         ; write out uninstaller
60         WriteUninstaller "$INSTDIR\uninst.exe"
61         SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
62         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\Zebra Program Directory.lnk" \
63                  "$INSTDIR"
64         WriteINIStr "$SMPROGRAMS\Index Data\Zebra\Zebra Home page.url" \
65               "InternetShortcut" "URL" "http://www.indexdata.dk/zebra/"
66         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\Uninstall Zebra.lnk" \
67                 "$INSTDIR\uninst.exe"
68         SetOutPath $INSTDIR
69         File ..\LICENSE.zebra
70         File ..\README
71         SetOutPath $INSTDIR
72         File /r ..\tab
73 SectionEnd ; end of default section
74
75 Section "Zebra Runtime"
76         SectionIn 1 2
77         SetOutPath $INSTDIR\bin
78         File ..\bin\*.exe
79         File ..\bin\iconv.dll
80         File ..\bin\zlib1.dll
81         File ..\bin\libxml2.dll
82         File ..\bin\yaz.dll
83         File ..\bin\libexpat.dll
84         File "${VS_RUNTIME}"
85 SectionEnd
86
87 Section "Zebra Development"
88         SectionIn 1
89         SetOutPath $INSTDIR\include
90         File ..\include\*.h
91         SetOutPath $INSTDIR\include\idzebra
92         File ..\include\idzebra\*.h
93         SetOutPath $INSTDIR\lib
94         File ..\lib\*.lib
95 SectionEnd
96
97 Section "Zebra Documentation"
98         SectionIn 1 2
99         SetOutPath $INSTDIR\doc
100         File ..\doc\*.html
101         File ..\doc\*.png
102         File ..\doc\*.xml
103         File ..\doc\*.in
104         File ..\doc\*.xsl
105         SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
106         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\HTML Documentation.lnk" \
107                  "$INSTDIR\doc\index.html"
108 SectionEnd
109
110 Section "Zebra Examples"
111         SectionIn 1 2
112
113         SetOutPath $INSTDIR
114
115         File /r ..\test
116         File /r ..\examples
117 SectionEnd
118
119 Section "Zebra Source"
120         SectionIn 1
121         SetOutPath $INSTDIR\util
122         File ..\util\*.c
123         SetOutPath $INSTDIR\dfa
124         File ..\dfa\*.c
125         File ..\dfa\*.h
126         SetOutPath $INSTDIR\index
127         File ..\index\*.c
128         File ..\index\*.h
129         SetOutPath $INSTDIR\isams
130         File ..\isams\*.c
131         SetOutPath $INSTDIR\isamc
132         File ..\isamc\*.c
133         File ..\isamc\*.h
134         SetOutPath $INSTDIR\isamb
135         File ..\isamb\*.c
136         SetOutPath $INSTDIR\data1
137         File ..\data1\*.c
138         SetOutPath $INSTDIR\recctrl
139         File ..\recctrl\*.c
140         File ..\recctrl\*.h
141         SetOutPath $INSTDIR\dict
142         File ..\dict\*.c
143         File ..\dict\*.h
144         SetOutPath $INSTDIR\bfile
145         File ..\bfile\*.c
146         File ..\bfile\*.h
147         SetOutPath $INSTDIR\rset
148         File ..\rset\*.c
149         SetOutPath $INSTDIR\test\api
150         File ..\test\api\*.c
151         File ..\test\api\*.cfg
152         SetOutPath $INSTDIR\win
153         File makefile
154         File *.nsi
155         File *.txt
156 SectionEnd
157
158 ; begin uninstall settings/section
159 UninstallText "This will uninstall Zebra ${VERSION} from your system"
160
161 Section Uninstall
162 ; add delete commands to delete whatever files/registry keys/etc you installed here.
163         Delete "$INSTDIR\uninst.exe"
164         DeleteRegKey HKLM "SOFTWARE\Index Data\Zebra"
165         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Zebra"
166         ExecWait '"$INSTDIR\bin\zebrasrv" -remove'
167         RMDir /r "$SMPROGRAMS\Index Data\Zebra"
168         RMDir /r $INSTDIR
169         IfFileExists $INSTDIR 0 Removed 
170                 MessageBox MB_OK|MB_ICONEXCLAMATION \
171                  "Note: $INSTDIR could not be removed."
172 Removed:
173 SectionEnd
174 ; eof