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