Bundle .manifest files. Use /r for doc stuff (due to doc/common)
[idzebra-moved-to-github.git] / win / zebra.nsi
1 ; $Id: zebra.nsi,v 1.30 2006-06-07 14:37:37 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\*.manifest
80         File ..\bin\idzebra.dll
81         File ..\bin\iconv.dll
82         File ..\bin\zlib1.dll
83         File ..\bin\libxml2.dll
84         File ..\bin\libxslt.dll
85         File ..\bin\yaz.dll
86         File ..\bin\libexpat.dll
87         File "${VS_RUNTIME}"
88 SectionEnd
89
90 Section "Zebra Development"
91         SectionIn 1
92         SetOutPath $INSTDIR\include
93         File ..\include\*.h
94         SetOutPath $INSTDIR\include\idzebra
95         File ..\include\idzebra\*.h
96         SetOutPath $INSTDIR\lib
97         File ..\lib\*.lib
98 SectionEnd
99
100 Section "Zebra Documentation"
101         SectionIn 1 2
102         SetOutPath $INSTDIR\doc
103         File /r ..\doc\*.html
104         File /r ..\doc\*.png
105         File /r ..\doc\*.xml
106         File /r ..\doc\*.xsl
107         SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
108         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\HTML Documentation.lnk" \
109                  "$INSTDIR\doc\index.html"
110 SectionEnd
111
112 Section "Zebra Examples"
113         SectionIn 1 2
114
115         SetOutPath $INSTDIR
116
117         File /r ..\test
118         File /r /x *.mf /x *.LCK ..\examples
119 SectionEnd
120
121 Section "Zebra Source"
122         SectionIn 1
123         SetOutPath $INSTDIR\util
124         File ..\util\*.c
125         SetOutPath $INSTDIR\dfa
126         File ..\dfa\*.c
127         File ..\dfa\*.h
128         SetOutPath $INSTDIR\index
129         File ..\index\*.c
130         File ..\index\*.h
131         SetOutPath $INSTDIR\isams
132         File ..\isams\*.c
133         SetOutPath $INSTDIR\isamc
134         File ..\isamc\*.c
135         File ..\isamc\*.h
136         SetOutPath $INSTDIR\isamb
137         File ..\isamb\*.c
138         SetOutPath $INSTDIR\data1
139         File ..\data1\*.c
140         SetOutPath $INSTDIR\recctrl
141         File ..\recctrl\*.c
142         File ..\recctrl\*.h
143         SetOutPath $INSTDIR\dict
144         File ..\dict\*.c
145         File ..\dict\*.h
146         SetOutPath $INSTDIR\bfile
147         File ..\bfile\*.c
148         File ..\bfile\*.h
149         SetOutPath $INSTDIR\rset
150         File ..\rset\*.c
151         SetOutPath $INSTDIR\test\api
152         File ..\test\api\*.c
153         File ..\test\api\*.cfg
154         SetOutPath $INSTDIR\win
155         File makefile
156         File *.nsi
157         File *.txt
158 SectionEnd
159
160 ; begin uninstall settings/section
161 UninstallText "This will uninstall Zebra ${VERSION} from your system"
162
163 Section Uninstall
164 ; add delete commands to delete whatever files/registry keys/etc you installed here.
165         Delete "$INSTDIR\uninst.exe"
166         DeleteRegKey HKLM "SOFTWARE\Index Data\Zebra"
167         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Zebra"
168         ExecWait '"$INSTDIR\bin\zebrasrv" -remove'
169         RMDir /r "$SMPROGRAMS\Index Data\Zebra"
170         RMDir /r $INSTDIR
171         IfFileExists $INSTDIR 0 Removed 
172                 MessageBox MB_OK|MB_ICONEXCLAMATION \
173                  "Note: $INSTDIR could not be removed."
174 Removed:
175 SectionEnd
176 ; eof