Update for VS 2013
[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\iconv.dll
98         File ..\bin\zlib1.dll
99         File ..\bin\libxml2.dll
100         File ..\bin\libxslt.dll
101         File ..\bin\yaz*.dll
102         File ..\bin\icu*.dll
103         File ..\bin\libexpat.dll
104 SectionEnd
105
106 Section "Zebra Development"
107         SectionIn 1
108         SetOutPath $INSTDIR\include
109         File ..\include\*.h
110         SetOutPath $INSTDIR\include\idzebra
111         File ..\include\idzebra\*.h
112         SetOutPath $INSTDIR\lib
113         File ..\lib\*.lib
114 SectionEnd
115
116 Section "Zebra Documentation"
117         SectionIn 1 2
118         SetOutPath $INSTDIR\doc
119         File /r ..\doc\*.html
120         File /r ..\doc\*.png
121         File /r ..\doc\*.xml
122         File /r ..\doc\*.xsl
123         SetOutPath "$SMPROGRAMS\Index Data\Zebra\"
124         CreateShortCut "$SMPROGRAMS\Index Data\Zebra\HTML Documentation.lnk" \
125                  "$INSTDIR\doc\index.html"
126 SectionEnd
127
128 Section "Zebra Examples"
129         SectionIn 1 2
130
131         SetOutPath $INSTDIR
132
133         File /r ..\test
134         File /r /x *.mf /x *.LCK ..\examples
135 SectionEnd
136
137 Section "Zebra Source"
138         SectionIn 1
139         SetOutPath $INSTDIR
140         File ..\IDMETA
141         SetOutPath $INSTDIR\util
142         File ..\util\*.c
143         File ..\util\*.tcl
144         SetOutPath $INSTDIR\dfa
145         File ..\dfa\*.c
146         File ..\dfa\*.h
147         SetOutPath $INSTDIR\index
148         File ..\index\*.c
149         File ..\index\*.h
150         SetOutPath $INSTDIR\isams
151         File ..\isams\*.c
152         SetOutPath $INSTDIR\isamc
153         File ..\isamc\*.c
154         File ..\isamc\*.h
155         SetOutPath $INSTDIR\isamb
156         File ..\isamb\*.c
157         SetOutPath $INSTDIR\data1
158         File ..\data1\*.c
159         SetOutPath $INSTDIR\dict
160         File ..\dict\*.c
161         File ..\dict\*.h
162         SetOutPath $INSTDIR\bfile
163         File ..\bfile\*.c
164         File ..\bfile\*.h
165         SetOutPath $INSTDIR\rset
166         File ..\rset\*.c
167         SetOutPath $INSTDIR\test\api
168         File ..\test\api\*.c
169         File ..\test\api\*.cfg
170         SetOutPath $INSTDIR\win
171         File makefile
172         File *.nsi
173         File *.txt
174 SectionEnd
175
176 ; begin uninstall settings/section
177 UninstallText "This will uninstall Zebra ${VERSION} from your system"
178
179 Section Uninstall
180 ; add delete commands to delete whatever files/registry keys/etc you installed here.
181         Delete "$INSTDIR\uninst.exe"
182         DeleteRegKey HKLM "SOFTWARE\Index Data\Zebra"
183         DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Zebra"
184         ExecWait '"$INSTDIR\bin\zebrasrv" -remove'
185         RMDir /r "$SMPROGRAMS\Index Data\Zebra"
186         RMDir /r $INSTDIR
187         IfFileExists $INSTDIR 0 Removed 
188                 MessageBox MB_OK|MB_ICONEXCLAMATION \
189                  "Note: $INSTDIR could not be removed."
190 Removed:
191 SectionEnd
192 ; eof