tests: check cpml_arc_to_curves() with different n_curves
[adg.git] / build / adg.nsi
blobe2e9341d67d4450127ca0bdc6a30965bccb5b06a
1 ; Installer script for ADG on Windows (both 32 and 64 bits)
2 ; Check NSIS website for details: http://nsis.sourceforge.net/
4 ; ADG - Automatic Drawing Generation
5 ; Copyright (C) 2010-2015 Nicola Fontana <ntd at entidi.it>
7 ; This file is free software; you can redistribute it and/or
8 ; modify it under the terms of the GNU Lesser General Public
9 ; License as published by the Free Software Foundation; either
10 ; version 2 of the License, or (at your option) any later version.
12 ; This library is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ; Lesser General Public License for more details.
17 ; You should have received a copy of the GNU Lesser General Public
18 ; License along with this library; if not, write to the
19 ; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 ; Boston, MA 02110-1301, USA.
23 ; ---------------------------------------------------------------
24 ; 1. Header file
26 !include "build/Custom.nsh"
27 !include "MUI2.nsh"
28 !include "${SRCDIR}/build/EnvVarUpdate.nsh"
30 Name "${PACKAGE_NAME} ${PACKAGE_VERSION}"
31 OutFile "${PACKAGE_NAME}-${PACKAGE_VERSION}-win${PACKAGE_ARCH}.exe"
32 InstallDir "$PROGRAMFILES${PACKAGE_ARCH}\${PACKAGE_NAME}"
34 SetCompressor /SOLID lzma
35 ShowInstDetails show
36 ShowUninstDetails show
37 SetDateSave on
38 RequestExecutionLevel highest
41 ; ---------------------------------------------------------------
42 ; 2. Interface configuration
44 !define MUI_ABORTWARNING
45 !define MUI_COMPONENTSPAGE_SMALLDESC
47 !define MUI_ICON "${SRCDIR}/build/adg.ico"
48 !define MUI_UNICON "${SRCDIR}/build/adg.ico"
50 !define MUI_HEADERIMAGE
51 !define MUI_HEADERIMAGE_RIGHT
52 !define MUI_HEADERIMAGE_BITMAP "${SRCDIR}/build/adg-header.bmp"
53 !define MUI_HEADERIMAGE_UNBITMAP "${SRCDIR}/build/adg-header.bmp"
55 !define MUI_WELCOMEFINISHPAGE_BITMAP "${SRCDIR}/build/adg-welcome.bmp"
56 !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${SRCDIR}/build/adg-welcome.bmp"
59 ; ---------------------------------------------------------------
60 ; 3. Pages
62 !insertmacro MUI_PAGE_WELCOME
63 !insertmacro MUI_PAGE_LICENSE "${SRCDIR}/COPYING"
64 !insertmacro MUI_PAGE_COMPONENTS
65 !insertmacro MUI_PAGE_DIRECTORY
66 !insertmacro MUI_PAGE_INSTFILES
67 !insertmacro MUI_PAGE_FINISH
69 !insertmacro MUI_UNPAGE_WELCOME
70 !insertmacro MUI_UNPAGE_INSTFILES
71 !insertmacro MUI_UNPAGE_FINISH
74 ; ---------------------------------------------------------------
75 ; 4. Language files
77 !insertmacro MUI_LANGUAGE "English"
78 !insertmacro MUI_LANGUAGE "Italian"
81 ; ---------------------------------------------------------------
82 ; 5. Reserve files
85 ; ---------------------------------------------------------------
86 ; 6. Sections
88 ; I. Introduction
90 !define DLLDIR "${PREFIX}/bin"
91 !define LUA_CMOD "${PREFIX}/lib/lua/5.2"
92 !define LUA_LMOD "${PREFIX}/share/lua/5.2"
94 Section $(TITLE_SecBase) SecBase
95 SectionIn RO
97 SetOutPath "$INSTDIR"
98 File /oname=adg-demo.exe "${BUILDDIR}/demo/.libs/adg-demo-uninstalled.exe"
99 File /oname=cpml-demo.exe "${BUILDDIR}/demo/.libs/cpml-demo-uninstalled.exe"
101 SetOutPath "$INSTDIR\share\adg"
102 File "${BUILDDIR}/demo/adg-demo.ui"
103 File "${BUILDDIR}/demo/cpml-demo.ui"
104 File "${SRCDIR}/demo/adg-16.png"
105 File "${SRCDIR}/demo/adg-32.png"
106 File "${SRCDIR}/demo/adg-48.png"
107 File "${SRCDIR}/demo/adg-64.png"
108 File "${SRCDIR}/demo/adg-128.png"
110 SetOutPath "$INSTDIR\share\adg\icons"
111 File "${SRCDIR}/demo/icons/adg-arc.png"
112 File "${SRCDIR}/demo/icons/adg-browsing.png"
113 File "${SRCDIR}/demo/icons/adg-curve.png"
114 File "${SRCDIR}/demo/icons/adg-intersection.png"
115 File "${SRCDIR}/demo/icons/adg-segment.png"
117 SetOutPath "$INSTDIR\bin"
118 File "${DLLDIR}/libwinpthread-*.dll"
119 File "${DLLDIR}/libgcc_*-*.dll"
120 File "${DLLDIR}/zlib1.dll"
121 File "${DLLDIR}/libbz2-*.dll"
122 File "${DLLDIR}/libexpat-*.dll"
123 File "${DLLDIR}/libintl-*.dll"
124 File "${DLLDIR}/iconv.dll"
125 File "${DLLDIR}/libffi-*.dll"
126 File "${DLLDIR}/libpng*-*.dll"
127 File "${DLLDIR}/libglib-2.0-*.dll"
128 File "${DLLDIR}/libgthread-2.0-*.dll"
129 File "${DLLDIR}/libgmodule-2.0-*.dll"
130 File "${DLLDIR}/libgobject-2.0-*.dll"
131 File "${DLLDIR}/libgio-2.0-*.dll"
132 File "${DLLDIR}/libfreetype-*.dll"
133 File "${DLLDIR}/libpixman-1-*.dll"
134 File "${DLLDIR}/libcairo-*.dll"
135 File "${DLLDIR}/libcairo-gobject-*.dll"
136 File "${DLLDIR}/libpango-1.0-*.dll"
137 File "${DLLDIR}/libpangocairo-1.0-*.dll"
138 File "${DLLDIR}/libpangowin32-1.0-*.dll"
139 File "${DLLDIR}/libatk-1.0-*.dll"
140 File "${DLLDIR}/libgdk_pixbuf-2.0-*.dll"
141 File "${DLLDIR}/libgdk-3-*.dll"
142 File "${DLLDIR}/libgtk-3-*.dll"
143 File "${BUILDDIR}/src/cpml/.libs/libcpml-1-*.dll"
144 File "${BUILDDIR}/src/adg/.libs/libadg-1-*.dll"
146 SetOutPath "$INSTDIR\share\glib-2.0\schemas"
147 File "${SRCDIR}/build/gschemas.compiled"
149 SetOutPath "$INSTDIR\share\icons"
150 File /r "${BUILDDIR}/_host/hicolor"
151 File /r "${BUILDDIR}/_host/minitheme"
153 SetOutPath "$INSTDIR\etc\gtk-3.0"
154 File "${SRCDIR}/build/settings.ini"
156 CreateDirectory "$SMPROGRAMS\ADG Canvas"
157 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG demonstration program.lnk" '"$INSTDIR\adg-demo.exe"'
158 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk" '"$INSTDIR\cpml-demo.exe"'
160 WriteUninstaller "$INSTDIR\uninstall.exe"
161 ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR\bin"
162 SectionEnd
164 Function .onInstSuccess
165 ; The uninstall shortcut is installed inside onInstSuccess so any subsequent
166 ; section (e.g. SecHTML) can install other shortcuts *before* this one.
167 CreateShortcut "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk" "$INSTDIR\uninstall.exe"
168 FunctionEnd
170 ; II. Language support
172 !include "${SRCDIR}/build/Locale.nsh"
174 Section $(TITLE_SecLanguages) SecLanguages
175 ; TODO: this should iterate over po/LINGUAS
176 !insertmacro FileLocale "it"
177 SectionEnd
179 ; III. Lua support
181 Section $(TITLE_SecLua) SecLua
182 SetOutPath "$INSTDIR\bin"
183 File "${DLLDIR}/libgirepository-1.0-*.dll"
184 File "${DLLDIR}/lua52.dll"
185 File "${DLLDIR}/lua.exe"
187 SetOutPath "$INSTDIR\lib\lua\5.2\lgi"
188 File "${LUA_CMOD}/lgi/corelgilua51.dll"
190 SetOutPath "$INSTDIR\share\lua\5.2"
191 File "${LUA_LMOD}/lgi.lua"
192 File /r "${LUA_LMOD}/lgi"
194 SetOutPath "$INSTDIR\lib\girepository-1.0"
195 File "${TYPELIBDIR}/Atk-1.0.typelib"
196 ; DBus-1.0.typelib
197 ; DBusGLib-1.0.typelib
198 ; GIRepository-2.0.typelib
199 ; GL-1.0.typelib
200 File "${TYPELIBDIR}/GLib-2.0.typelib"
201 File "${TYPELIBDIR}/GModule-2.0.typelib"
202 File "${TYPELIBDIR}/GObject-2.0.typelib"
203 File "${TYPELIBDIR}/Gdk-3.0.typelib"
204 File "${TYPELIBDIR}/GdkPixbuf-2.0.typelib"
205 File "${TYPELIBDIR}/GdkWin32-3.0.typelib"
206 File "${TYPELIBDIR}/Gio-2.0.typelib"
207 File "${TYPELIBDIR}/Gtk-3.0.typelib"
208 File "${TYPELIBDIR}/HarfBuzz-0.0.typelib"
209 File "${TYPELIBDIR}/Pango-1.0.typelib"
210 File "${TYPELIBDIR}/PangoCairo-1.0.typelib"
211 File "${TYPELIBDIR}/PangoFT2-1.0.typelib"
212 File "${TYPELIBDIR}/cairo-1.0.typelib"
213 File "${TYPELIBDIR}/fontconfig-2.0.typelib"
214 File "${TYPELIBDIR}/freetype2-2.0.typelib"
215 ; libxml2-2.0.typelib
216 File "${TYPELIBDIR}/win32-1.0.typelib"
217 ; xfixes-4.0.typelib
218 ; xft-2.0.typelib
219 ; xlib-2.0.typelib
220 ; xrandr-1.3.typelib
222 SetOutPath "$INSTDIR\share\gir-1.0"
223 File "${GIRDIR}/Atk-1.0.gir"
224 File "${GIRDIR}/GLib-2.0.gir"
225 File "${GIRDIR}/GModule-2.0.gir"
226 File "${GIRDIR}/GObject-2.0.gir"
227 File "${GIRDIR}/Gdk-3.0.gir"
228 File "${GIRDIR}/GdkPixbuf-2.0.gir"
229 File "${GIRDIR}/GdkWin32-3.0.gir"
230 File "${GIRDIR}/Gio-2.0.gir"
231 File "${GIRDIR}/Gtk-3.0.gir"
232 File "${GIRDIR}/HarfBuzz-0.0.gir"
233 File "${GIRDIR}/Pango-1.0.gir"
234 File "${GIRDIR}/PangoCairo-1.0.gir"
235 File "${GIRDIR}/PangoFT2-1.0.gir"
236 File "${GIRDIR}/cairo-1.0.gir"
237 File "${GIRDIR}/fontconfig-2.0.gir"
238 File "${GIRDIR}/freetype2-2.0.gir"
239 File "${GIRDIR}/win32-1.0.gir"
241 CreateShortcut "$SMPROGRAMS\ADG Canvas\Lua interpreter.lnk" '"$INSTDIR\bin\lua.exe"'
242 SectionEnd
244 ; IV. Documentation
246 SectionGroup /e $(TITLE_SecDocumentation) SecDocumentation
248 Section $(TITLE_SecHTML) SecHTML
249 SetOutPath "$INSTDIR\share\gtk-doc\html\cpml"
250 File /r "${BUILDDIR}/_host/docs/cpml/html/*.*"
252 SetOutPath "$INSTDIR\share\gtk-doc\html\adg"
253 File /r "${BUILDDIR}/_host/docs/adg/html/*.*"
255 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\cpml\index.html"'
256 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\adg\index.html"'
257 SectionEnd
259 Section /o $(TITLE_SecPDF) SecPDF
260 SetOutPath "$INSTDIR\share\gtk-doc"
261 File /r "${BUILDDIR}/_host/docs/cpml/cpml.pdf"
262 File /r "${BUILDDIR}/_host/docs/adg/adg.pdf"
264 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk" '"$INSTDIR\share\gtk-doc\cpml.pdf"'
265 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk" '"$INSTDIR\share\gtk-doc\adg.pdf"'
266 SectionEnd
268 SectionGroupEnd
270 ; V. Uninstaller
272 Section "Uninstall"
273 Delete "$SMPROGRAMS\ADG Canvas\ADG Demonstration program.lnk"
274 Delete "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk"
276 Delete "$SMPROGRAMS\ADG Canvas\Lua interpreter.lnk"
278 Delete "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk"
279 Delete "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk"
280 Delete "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk"
281 Delete "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk"
283 Delete "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk"
284 RMDir "$SMPROGRAMS\ADG Canvas"
286 Delete "$INSTDIR\bin\libgtk-3-*.dll"
287 Delete "$INSTDIR\bin\libgdk-3-*.dll"
288 Delete "$INSTDIR\bin\libgdk_pixbuf-2.0-*.dll"
289 Delete "$INSTDIR\bin\libatk-1.0-*.dll"
290 Delete "$INSTDIR\bin\libpangowin32-1.0-*.dll"
291 Delete "$INSTDIR\bin\libpangocairo-1.0-*.dll"
292 Delete "$INSTDIR\bin\libpango-1.0-*.dll"
293 Delete "$INSTDIR\bin\libcairo-gobject-*.dll"
294 Delete "$INSTDIR\bin\libcairo-*.dll"
295 Delete "$INSTDIR\bin\libpixman-1-*.dll"
296 Delete "$INSTDIR\bin\libfreetype-*.dll"
297 Delete "$INSTDIR\bin\libgio-2.0-*.dll"
298 Delete "$INSTDIR\bin\libgobject-2.0-*.dll"
299 Delete "$INSTDIR\bin\libgmodule-2.0-*.dll"
300 Delete "$INSTDIR\bin\libgthread-2.0-*.dll"
301 Delete "$INSTDIR\bin\libglib-2.0-*.dll"
302 Delete "$INSTDIR\bin\libpng*-*.dll"
303 Delete "$INSTDIR\bin\libffi-*.dll"
304 Delete "$INSTDIR\bin\iconv.dll"
305 Delete "$INSTDIR\bin\libintl-*.dll"
306 Delete "$INSTDIR\bin\libexpat-*.dll"
307 Delete "$INSTDIR\bin\libbz2-*.dll"
308 Delete "$INSTDIR\bin\zlib1.dll"
309 Delete "$INSTDIR\bin\libgcc_*-*.dll"
310 Delete "$INSTDIR\bin\libwinpthread-*.dll"
311 Delete "$INSTDIR\bin\libcpml-1-*.dll"
312 Delete "$INSTDIR\bin\libadg-1-*.dll"
314 Delete "$INSTDIR\bin\libgirepository-1.0-*.dll"
315 Delete "$INSTDIR\bin\lua52.dll"
316 Delete "$INSTDIR\bin\lua.exe"
318 RMDir "$INSTDIR\bin"
320 Delete "$INSTDIR\lib\lua\5.2\lgi\corelgilua51.dll"
321 RMDir "$INSTDIR\lib\lua\5.2\lgi"
322 RMDir "$INSTDIR\lib\lua\5.2"
323 RMDir "$INSTDIR\lib\lua"
325 Delete "$INSTDIR\lib\girepository-1.0\Atk-1.0.typelib"
326 Delete "$INSTDIR\lib\girepository-1.0\GLib-2.0.typelib"
327 Delete "$INSTDIR\lib\girepository-1.0\GModule-2.0.typelib"
328 Delete "$INSTDIR\lib\girepository-1.0\GObject-2.0.typelib"
329 Delete "$INSTDIR\lib\girepository-1.0\Gdk-3.0.typelib"
330 Delete "$INSTDIR\lib\girepository-1.0\GdkPixbuf-2.0.typelib"
331 Delete "$INSTDIR\lib\girepository-1.0\GdkWin32-3.0.typelib"
332 Delete "$INSTDIR\lib\girepository-1.0\Gio-2.0.typelib"
333 Delete "$INSTDIR\lib\girepository-1.0\Gtk-3.0.typelib"
334 Delete "$INSTDIR\lib\girepository-1.0\HarfBuzz-0.0.typelib"
335 Delete "$INSTDIR\lib\girepository-1.0\Pango-1.0.typelib"
336 Delete "$INSTDIR\lib\girepository-1.0\PangoCairo-1.0.typelib"
337 Delete "$INSTDIR\lib\girepository-1.0\PangoFT2-1.0.typelib"
338 Delete "$INSTDIR\lib\girepository-1.0\cairo-1.0.typelib"
339 Delete "$INSTDIR\lib\girepository-1.0\fontconfig-2.0.typelib"
340 Delete "$INSTDIR\lib\girepository-1.0\freetype2-2.0.typelib"
341 Delete "$INSTDIR\lib\girepository-1.0\win32-1.0.typelib"
342 RMDir "$INSTDIR\lib\girepository-1.0"
344 RMDir "$INSTDIR\lib"
346 Delete "$INSTDIR\share\adg\icons\adg-segment.png"
347 Delete "$INSTDIR\share\adg\icons\adg-intersection.png"
348 Delete "$INSTDIR\share\adg\icons\adg-curve.png"
349 Delete "$INSTDIR\share\adg\icons\adg-browsing.png"
350 Delete "$INSTDIR\share\adg\icons\adg-arc.png"
351 RMDir "$INSTDIR\share\adg\icons"
353 Delete "$INSTDIR\share\adg\adg-demo.ui"
354 Delete "$INSTDIR\share\adg\cpml-demo.ui"
355 Delete "$INSTDIR\share\adg\adg-128.png"
356 Delete "$INSTDIR\share\adg\adg-64.png"
357 Delete "$INSTDIR\share\adg\adg-48.png"
358 Delete "$INSTDIR\share\adg\adg-32.png"
359 Delete "$INSTDIR\share\adg\adg-16.png"
360 RMDir "$INSTDIR\share\adg"
362 Delete "$INSTDIR\share\glib-2.0\schemas\gschemas.compiled"
363 RMDir "$INSTDIR\share\glib-2.0\schemas"
364 RMDir "$INSTDIR\share\glib-2.0"
366 ; TODO: this should iterate over po/LINGUAS
367 !insertmacro DeleteLocale "it"
369 RMDir "$INSTDIR\share\locale"
370 RMDir /r "$INSTDIR\share\gtk-doc\html\cpml"
371 RMDir /r "$INSTDIR\share\gtk-doc\html\adg"
372 RMDir "$INSTDIR\share\gtk-doc\html"
374 Delete "$INSTDIR\share\gtk-doc\adg.pdf"
375 Delete "$INSTDIR\share\gtk-doc\cpml.pdf"
376 RMDir "$INSTDIR\share\gtk-doc"
378 RMDir /r "$INSTDIR\share\icons"
380 SetOutPath "$INSTDIR\share\gir-1.0"
381 Delete "$INSTDIR\share\gir-1.0\Atk-1.0.gir"
382 Delete "$INSTDIR\share\gir-1.0\GLib-2.0.gir"
383 Delete "$INSTDIR\share\gir-1.0\GModule-2.0.gir"
384 Delete "$INSTDIR\share\gir-1.0\GObject-2.0.gir"
385 Delete "$INSTDIR\share\gir-1.0\Gdk-3.0.gir"
386 Delete "$INSTDIR\share\gir-1.0\GdkPixbuf-2.0.gir"
387 Delete "$INSTDIR\share\gir-1.0\GdkWin32-3.0.gir"
388 Delete "$INSTDIR\share\gir-1.0\Gio-2.0.gir"
389 Delete "$INSTDIR\share\gir-1.0\Gtk-3.0.gir"
390 Delete "$INSTDIR\share\gir-1.0\HarfBuzz-0.0.gir"
391 Delete "$INSTDIR\share\gir-1.0\Pango-1.0.gir"
392 Delete "$INSTDIR\share\gir-1.0\PangoCairo-1.0.gir"
393 Delete "$INSTDIR\share\gir-1.0\PangoFT2-1.0.gir"
394 Delete "$INSTDIR\share\gir-1.0\cairo-1.0.gir"
395 Delete "$INSTDIR\share\gir-1.0\fontconfig-2.0.gir"
396 Delete "$INSTDIR\share\gir-1.0\freetype2-2.0.gir"
397 Delete "$INSTDIR\share\gir-1.0\win32-1.0.gir"
398 RMDir "$INSTDIR\share\gir-1.0"
400 Delete "$INSTDIR\share\lua\5.2\lgi.lua"
401 RMDir /r "$INSTDIR\share\lua\5.2\lgi"
402 RMDir "$INSTDIR\share\lua\5.2"
403 RMDir "$INSTDIR\share\lua"
405 RMDir "$INSTDIR\share"
407 Delete "$INSTDIR\etc\gtk-3.0\settings.ini"
408 RMDir "$INSTDIR\etc\gtk-3.0"
409 RMDir "$INSTDIR\etc"
411 Delete "$INSTDIR\adg-demo.exe"
412 Delete "$INSTDIR\cpml-demo.exe"
413 Delete "$INSTDIR\uninstall.exe"
414 RMDir "$INSTDIR"
416 ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\bin"
417 SectionEnd
420 ; ---------------------------------------------------------------
421 ; 7. Internationalization
423 !include "${SRCDIR}/build/Translations.nsh"
425 Function .onInit
426 !insertmacro MUI_LANGDLL_DISPLAY
427 FunctionEnd
429 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
430 !insertmacro MUI_DESCRIPTION_TEXT ${SecBase} $(DESC_SecBase)
431 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(DESC_SecLanguages)
432 !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} $(DESC_SecDocumentation)
433 !insertmacro MUI_DESCRIPTION_TEXT ${SecHTML} $(DESC_SecHTML)
434 !insertmacro MUI_DESCRIPTION_TEXT ${SecPDF} $(DESC_SecPDF)
435 !insertmacro MUI_FUNCTION_DESCRIPTION_END