WIN32 install for Zebra using NSIS from Nullsoft
[idzebra-moved-to-github.git] / win / zebra.nsi
1 ; $Id: zebra.nsi,v 1.1 2002-08-30 11:28:55 adam Exp $
2
3 !define VERSION "1.3.1"
4
5 Name "Zebra"
6 Caption "Index Data Yebra ${VERSION} Setup"
7 OutFile "zebra_${VERSION}.exe"
8
9 LicenseText "You must read the following license before installing:"
10 LicenseData license.txt
11
12 ComponentText "This will install Zebra on your computer:"
13 InstType "Full (w/ Source)"
14 InstType "Lite (w/o Source)"
15
16 ; Some default compiler settings (uncomment and change at will):
17 ; SetCompress auto ; (can be off or force)
18 ; SetDatablockOptimize on ; (can be off)
19 ; CRCCheck on ; (can be off)
20 ; AutoCloseWindow false ; (can be true for the window go away automatically at end)
21 ; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
22 ; SetDateSave off ; (can be on to have files restored to their orginal date)
23
24 InstallDir "$PROGRAMFILES\Zebra"
25 InstallDirRegKey HKLM "SOFTWARE\Index Data\Zebra" ""
26 DirShow show ; (make this hide to not let the user change it)
27 DirText "Select the directory to install Zebra in:"
28
29 Section "" ; (default section)
30         SetOutPath "$INSTDIR"
31         ; add files / whatever that need to be installed here.
32         WriteRegStr HKLM "SOFTWARE\Index Data\Zebra" "" "$INSTDIR"
33         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "DisplayName" "Zebra ${VERSION} (remove only)"
34         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zebra" "UninstallString" '"$INSTDIR\uninst.exe"'
35         ; write out uninstaller
36         WriteUninstaller "$INSTDIR\uninst.exe"
37         SetOutPath $SMPROGRAMS\Zebra
38         CreateShortCut "$SMPROGRAMS\Zebra\Zebra Program Directory.lnk" \
39                  "$INSTDIR"
40         WriteINIStr "$SMPROGRAMS\Zebra\Zebra Home page.url" \
41               "InternetShortcut" "URL" "http://www.indexdata.dk/zebra/"
42         CreateShortCut "$SMPROGRAMS\Zebra\Uninstall Zebra.lnk" \
43                 "$INSTDIR\uninst.exe"
44         SetOutPath $INSTDIR
45         File ..\LICENSE.zebra
46         File ..\README
47         SetOutPath $INSTDIR
48         File /r ..\tab
49 SectionEnd ; end of default section
50
51 Section "Zebra Runtime"
52         SectionIn 1 2
53         IfFileExists "$INSTDIR\bin\zebrasrv.exe" 0 Noservice
54         ExecWait '"$INSTDIR\bin\zebrasrv.exe" -remove'
55 Noservice:
56         SetOutPath $INSTDIR\bin
57         File ..\bin\*.exe
58         File ..\bin\*.dll
59         SetOutPath $SMPROGRAMS\Zebra
60         CreateShortCut "$SMPROGRAMS\Zebra\Zebraidx.lnk" \
61                  "$INSTDIR\bin\zebraidx.exe"
62         SetOutPath $SMPROGRAMS\Zebra\Server
63         CreateShortCut "$SMPROGRAMS\Zebra\Server\Server on console on port 9999.lnk" \
64                  "$INSTDIR\bin\zebrasrv.exe"
65         CreateShortCut "$SMPROGRAMS\Zebra\Server\Install Z39.50 service on port 210.lnk" \
66                   "$INSTDIR\bin\zebrasrv.exe" '-installa tcp:@:210'
67         CreateShortCut "$SMPROGRAMS\Zebra\Server\Remove Z39.50 service.lnk" \
68                  "$INSTDIR\bin\zebrasrv.exe" '-remove'
69 SectionEnd
70
71 Section "Zebra Development"
72         SectionIn 1
73         SetOutPath $INSTDIR\include
74         File ..\include\*.h
75         SetOutPath $INSTDIR\lib
76         File ..\lib\*.lib
77 SectionEnd
78
79 Section "Zebra Documentation"
80         SectionIn 1 2
81         SetOutPath $INSTDIR
82         File /r ..\doc
83         SetOutPath $SMPROGRAMS\Zebra
84         CreateShortCut "$SMPROGRAMS\Zebra\HTML Documentation.lnk" \
85                  "$INSTDIR\doc\zebra.html"
86         CreateShortCut "$SMPROGRAMS\Zebra\PDF Documentaion.lnk" \
87                  "$INSTDIR\doc\zebra.pdf"
88 SectionEnd
89
90 Section "Zebra Examples"
91         SectionIn 1 2
92
93         SetOutPath $INSTDIR
94
95         File /r ..\test
96         File /r ..\examples
97 SectionEnd
98
99 Section "Zebra Source"
100         SectionIn 1
101         SetOutPath $INSTDIR\util
102         File ..\util\*.c
103         SetOutPath $INSTDIR\dfa
104         File ..\dfa\*.c
105         File ..\dfa\*.h
106         SetOutPath $INSTDIR\index
107         File ..\index\*.c
108         File ..\index\*.h
109         SetOutPath $INSTDIR\isams
110         File ..\isams\*.c
111         SetOutPath $INSTDIR\isam
112         File ..\isam\*.c
113         File ..\isam\*.h
114         SetOutPath $INSTDIR\isamc
115         File ..\isamc\*.c
116         File ..\isamc\*.h
117         SetOutPath $INSTDIR\isamb
118         File ..\isamb\*.c
119         SetOutPath $INSTDIR\recctrl
120         File ..\recctrl\*.c
121         File ..\recctrl\*.h
122         SetOutPath $INSTDIR\dict
123         File ..\dict\*.c
124         SetOutPath $INSTDIR\bfile
125         File ..\bfile\*.c
126         File ..\bfile\*.h
127         SetOutPath $INSTDIR\rset
128         File ..\rset\*.c
129         SetOutPath $INSTDIR\test\api
130         File ..\test\api\*.c
131         File ..\test\api\*.cfg
132         SetOutPath $INSTDIR\isamg
133         File ..\isamg\*.c
134         SetOutPath $INSTDIR\win
135         File makefile
136         File *.nsi
137         File *.txt
138 SectionEnd
139
140 ; begin uninstall settings/section
141 UninstallText "This will uninstall Zebra ${VERSION} from your system"
142
143 Section Uninstall
144 ; add delete commands to delete whatever files/registry keys/etc you installed here.
145         Delete "$INSTDIR\uninst.exe"
146         DeleteRegKey HKLM "SOFTWARE\Index Data\Zebra"
147         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Zebra"
148         ExecWait '"$INSTDIR\bin\zebrasrv" -remove'
149         RMDir /r $SMPROGRAMS\Zebra
150         RMDir /r $INSTDIR
151         IfFileExists $INSTDIR 0 Removed 
152                 MessageBox MB_OK|MB_ICONEXCLAMATION \
153                  "Note: $INSTDIR could not be removed."
154 Removed:
155 SectionEnd
156 ; eof