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