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