Towards 2.0.16
[idzebra-moved-to-github.git] / win / zebra.nsi
1 ; $Id: zebra.nsi,v 1.42 2007-09-12 07:46:41 adam Exp $
2
3 !define VERSION "2.0.16"
4
5 ; VS 2005
6 ; !define VS_RUNTIME_DLL      "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\msvcr80.dll"
7 ; !define VS_RUNTIME_MANIFEST "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\Microsoft.VC80.CRT.manifest"
8
9 ; VS 2003
10 !define VS_RUNTIME_DLL "c:\Program files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\msvcr71.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 "${VS_RUNTIME_DLL}"
79 ; File "${VS_RUNTIME_MANIFEST}"
80         File ..\bin\*.exe
81 ; File ..\bin\*.manifest
82         File ..\bin\idzebra.dll
83         File ..\bin\iconv.dll
84         File ..\bin\zlib1.dll
85         File ..\bin\libxml2.dll
86         File ..\bin\libxslt.dll
87         File ..\bin\yaz3.dll
88         File ..\bin\libexpat.dll
89 SectionEnd
90
91 Section "Zebra Development"
92         SectionIn 1
93         SetOutPath $INSTDIR\include
94         File ..\include\*.h
95         SetOutPath $INSTDIR\include\idzebra
96         File ..\include\idzebra\*.h
97         SetOutPath $INSTDIR\lib
98         File ..\lib\*.lib
99 SectionEnd
100
101 Section "Zebra Documentation"
102         SectionIn 1 2
103         SetOutPath $INSTDIR\doc
104         File /r ..\doc\*.html
105         File /r ..\doc\*.png
106         File /r ..\doc\*.xml
107         File /r ..\doc\*.xsl
108         SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
109         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\HTML Documentation.lnk" \
110                  "$INSTDIR\doc\index.html"
111 SectionEnd
112
113 Section "Zebra Examples"
114         SectionIn 1 2
115
116         SetOutPath $INSTDIR
117
118         File /r ..\test
119         File /r /x *.mf /x *.LCK ..\examples
120 SectionEnd
121
122 Section "Zebra Source"
123         SectionIn 1
124         SetOutPath $INSTDIR\util
125         File ..\util\*.c
126         SetOutPath $INSTDIR\dfa
127         File ..\dfa\*.c
128         File ..\dfa\*.h
129         SetOutPath $INSTDIR\index
130         File ..\index\*.c
131         File ..\index\*.h
132         SetOutPath $INSTDIR\isams
133         File ..\isams\*.c
134         SetOutPath $INSTDIR\isamc
135         File ..\isamc\*.c
136         File ..\isamc\*.h
137         SetOutPath $INSTDIR\isamb
138         File ..\isamb\*.c
139         SetOutPath $INSTDIR\data1
140         File ..\data1\*.c
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