build: unset catalogdir on glade not found
[adg.git] / build / adg.nsi
blob7dcb8433d883ad9b289e695c289c8790f94ac9a8
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}/libpangoft2-1.0-*.dll"
140 File "${DLLDIR}/libatk-1.0-*.dll"
141 File "${DLLDIR}/libgdk_pixbuf-2.0-*.dll"
142 File "${DLLDIR}/libgdk-3-*.dll"
143 File "${DLLDIR}/libgtk-3-*.dll"
144 File "${BUILDDIR}/src/cpml/.libs/libcpml-1-*.dll"
145 File "${BUILDDIR}/src/adg/.libs/libadg-1-*.dll"
147 SetOutPath "$INSTDIR\share\glib-2.0\schemas"
148 File "${SRCDIR}/build/gschemas.compiled"
150 SetOutPath "$INSTDIR\share\icons"
151 File /r "${BUILDDIR}/_host/hicolor"
152 File /r "${BUILDDIR}/_host/minitheme"
154 SetOutPath "$INSTDIR\etc\gtk-3.0"
155 File "${SRCDIR}/build/settings.ini"
157 CreateDirectory "$SMPROGRAMS\ADG Canvas"
158 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG demonstration program.lnk" '"$INSTDIR\adg-demo.exe"'
159 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk" '"$INSTDIR\cpml-demo.exe"'
161 WriteUninstaller "$INSTDIR\uninstall.exe"
162 ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR\bin"
163 SectionEnd
165 Function .onInstSuccess
166 ; The uninstall shortcut is installed inside onInstSuccess so any subsequent
167 ; section (e.g. SecHTML) can install other shortcuts *before* this one.
168 CreateShortcut "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk" "$INSTDIR\uninstall.exe"
169 FunctionEnd
171 ; II. Language support
173 !include "${SRCDIR}/build/Locale.nsh"
175 Section $(TITLE_SecLanguages) SecLanguages
176 ; TODO: this should iterate over po/LINGUAS
177 !insertmacro FileLocale "it"
178 SectionEnd
180 ; III. Lua support
182 Section $(TITLE_SecLua) SecLua
183 SetOutPath "$INSTDIR\bin"
184 File "${DLLDIR}/libgirepository-1.0-*.dll"
185 File "${DLLDIR}/lua52.dll"
186 File "${DLLDIR}/lua.exe"
188 SetOutPath "$INSTDIR\lib\lua\5.2\lgi"
189 File "${LUA_CMOD}/lgi/corelgilua51.dll"
191 SetOutPath "$INSTDIR\share\lua\5.2"
192 File "${LUA_LMOD}/lgi.lua"
193 File /r "${LUA_LMOD}/lgi"
195 SetOutPath "$INSTDIR\lib\girepository-1.0"
196 File "${TYPELIBDIR}/Atk-1.0.typelib"
197 ; DBus-1.0.typelib
198 ; DBusGLib-1.0.typelib
199 ; GIRepository-2.0.typelib
200 ; GL-1.0.typelib
201 File "${TYPELIBDIR}/GLib-2.0.typelib"
202 File "${TYPELIBDIR}/GModule-2.0.typelib"
203 File "${TYPELIBDIR}/GObject-2.0.typelib"
204 File "${TYPELIBDIR}/Gdk-3.0.typelib"
205 File "${TYPELIBDIR}/GdkPixbuf-2.0.typelib"
206 File "${TYPELIBDIR}/GdkWin32-3.0.typelib"
207 File "${TYPELIBDIR}/Gio-2.0.typelib"
208 File "${TYPELIBDIR}/Gtk-3.0.typelib"
209 File "${TYPELIBDIR}/HarfBuzz-0.0.typelib"
210 File "${TYPELIBDIR}/Pango-1.0.typelib"
211 File "${TYPELIBDIR}/PangoCairo-1.0.typelib"
212 File "${TYPELIBDIR}/PangoFT2-1.0.typelib"
213 File "${TYPELIBDIR}/cairo-1.0.typelib"
214 File "${TYPELIBDIR}/fontconfig-2.0.typelib"
215 File "${TYPELIBDIR}/freetype2-2.0.typelib"
216 ; libxml2-2.0.typelib
217 File "${TYPELIBDIR}/win32-1.0.typelib"
218 ; xfixes-4.0.typelib
219 ; xft-2.0.typelib
220 ; xlib-2.0.typelib
221 ; xrandr-1.3.typelib
223 SetOutPath "$INSTDIR\share\gir-1.0"
224 File "${GIRDIR}/Atk-1.0.gir"
225 File "${GIRDIR}/GLib-2.0.gir"
226 File "${GIRDIR}/GModule-2.0.gir"
227 File "${GIRDIR}/GObject-2.0.gir"
228 File "${GIRDIR}/Gdk-3.0.gir"
229 File "${GIRDIR}/GdkPixbuf-2.0.gir"
230 File "${GIRDIR}/GdkWin32-3.0.gir"
231 File "${GIRDIR}/Gio-2.0.gir"
232 File "${GIRDIR}/Gtk-3.0.gir"
233 File "${GIRDIR}/HarfBuzz-0.0.gir"
234 File "${GIRDIR}/Pango-1.0.gir"
235 File "${GIRDIR}/PangoCairo-1.0.gir"
236 File "${GIRDIR}/PangoFT2-1.0.gir"
237 File "${GIRDIR}/cairo-1.0.gir"
238 File "${GIRDIR}/fontconfig-2.0.gir"
239 File "${GIRDIR}/freetype2-2.0.gir"
240 File "${GIRDIR}/win32-1.0.gir"
242 CreateShortcut "$SMPROGRAMS\ADG Canvas\Lua interpreter.lnk" '"$INSTDIR\bin\lua.exe"'
243 SectionEnd
245 ; IV. Documentation
247 SectionGroup /e $(TITLE_SecDocumentation) SecDocumentation
249 Section $(TITLE_SecHTML) SecHTML
250 SetOutPath "$INSTDIR\share\gtk-doc\html\cpml"
251 File /r "${BUILDDIR}/_host/docs/cpml/html/*.*"
253 SetOutPath "$INSTDIR\share\gtk-doc\html\adg"
254 File /r "${BUILDDIR}/_host/docs/adg/html/*.*"
256 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\cpml\index.html"'
257 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\adg\index.html"'
258 SectionEnd
260 Section /o $(TITLE_SecPDF) SecPDF
261 SetOutPath "$INSTDIR\share\gtk-doc"
262 File /r "${BUILDDIR}/_host/docs/cpml/cpml.pdf"
263 File /r "${BUILDDIR}/_host/docs/adg/adg.pdf"
265 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk" '"$INSTDIR\share\gtk-doc\cpml.pdf"'
266 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk" '"$INSTDIR\share\gtk-doc\adg.pdf"'
267 SectionEnd
269 SectionGroupEnd
271 ; V. Uninstaller
273 Section "Uninstall"
274 Delete "$SMPROGRAMS\ADG Canvas\ADG Demonstration program.lnk"
275 Delete "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk"
277 Delete "$SMPROGRAMS\ADG Canvas\Lua interpreter.lnk"
279 Delete "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk"
280 Delete "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk"
281 Delete "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk"
282 Delete "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk"
284 Delete "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk"
285 RMDir "$SMPROGRAMS\ADG Canvas"
287 Delete "$INSTDIR\bin\libgtk-3-*.dll"
288 Delete "$INSTDIR\bin\libgdk-3-*.dll"
289 Delete "$INSTDIR\bin\libgdk_pixbuf-2.0-*.dll"
290 Delete "$INSTDIR\bin\libatk-1.0-*.dll"
291 Delete "$INSTDIR\bin\libpangoft2-1.0-*.dll"
292 Delete "$INSTDIR\bin\libpangowin32-1.0-*.dll"
293 Delete "$INSTDIR\bin\libpangocairo-1.0-*.dll"
294 Delete "$INSTDIR\bin\libpango-1.0-*.dll"
295 Delete "$INSTDIR\bin\libcairo-gobject-*.dll"
296 Delete "$INSTDIR\bin\libcairo-*.dll"
297 Delete "$INSTDIR\bin\libpixman-1-*.dll"
298 Delete "$INSTDIR\bin\libfreetype-*.dll"
299 Delete "$INSTDIR\bin\libgio-2.0-*.dll"
300 Delete "$INSTDIR\bin\libgobject-2.0-*.dll"
301 Delete "$INSTDIR\bin\libgmodule-2.0-*.dll"
302 Delete "$INSTDIR\bin\libgthread-2.0-*.dll"
303 Delete "$INSTDIR\bin\libglib-2.0-*.dll"
304 Delete "$INSTDIR\bin\libpng*-*.dll"
305 Delete "$INSTDIR\bin\libffi-*.dll"
306 Delete "$INSTDIR\bin\iconv.dll"
307 Delete "$INSTDIR\bin\libintl-*.dll"
308 Delete "$INSTDIR\bin\libexpat-*.dll"
309 Delete "$INSTDIR\bin\libbz2-*.dll"
310 Delete "$INSTDIR\bin\zlib1.dll"
311 Delete "$INSTDIR\bin\libgcc_*-*.dll"
312 Delete "$INSTDIR\bin\libwinpthread-*.dll"
313 Delete "$INSTDIR\bin\libcpml-1-*.dll"
314 Delete "$INSTDIR\bin\libadg-1-*.dll"
316 Delete "$INSTDIR\bin\libgirepository-1.0-*.dll"
317 Delete "$INSTDIR\bin\lua52.dll"
318 Delete "$INSTDIR\bin\lua.exe"
320 RMDir "$INSTDIR\bin"
322 Delete "$INSTDIR\lib\lua\5.2\lgi\corelgilua51.dll"
323 RMDir "$INSTDIR\lib\lua\5.2\lgi"
324 RMDir "$INSTDIR\lib\lua\5.2"
325 RMDir "$INSTDIR\lib\lua"
327 Delete "$INSTDIR\lib\girepository-1.0\Atk-1.0.typelib"
328 Delete "$INSTDIR\lib\girepository-1.0\GLib-2.0.typelib"
329 Delete "$INSTDIR\lib\girepository-1.0\GModule-2.0.typelib"
330 Delete "$INSTDIR\lib\girepository-1.0\GObject-2.0.typelib"
331 Delete "$INSTDIR\lib\girepository-1.0\Gdk-3.0.typelib"
332 Delete "$INSTDIR\lib\girepository-1.0\GdkPixbuf-2.0.typelib"
333 Delete "$INSTDIR\lib\girepository-1.0\GdkWin32-3.0.typelib"
334 Delete "$INSTDIR\lib\girepository-1.0\Gio-2.0.typelib"
335 Delete "$INSTDIR\lib\girepository-1.0\Gtk-3.0.typelib"
336 Delete "$INSTDIR\lib\girepository-1.0\HarfBuzz-0.0.typelib"
337 Delete "$INSTDIR\lib\girepository-1.0\Pango-1.0.typelib"
338 Delete "$INSTDIR\lib\girepository-1.0\PangoCairo-1.0.typelib"
339 Delete "$INSTDIR\lib\girepository-1.0\PangoFT2-1.0.typelib"
340 Delete "$INSTDIR\lib\girepository-1.0\cairo-1.0.typelib"
341 Delete "$INSTDIR\lib\girepository-1.0\fontconfig-2.0.typelib"
342 Delete "$INSTDIR\lib\girepository-1.0\freetype2-2.0.typelib"
343 Delete "$INSTDIR\lib\girepository-1.0\win32-1.0.typelib"
344 RMDir "$INSTDIR\lib\girepository-1.0"
346 RMDir "$INSTDIR\lib"
348 Delete "$INSTDIR\share\adg\icons\adg-segment.png"
349 Delete "$INSTDIR\share\adg\icons\adg-intersection.png"
350 Delete "$INSTDIR\share\adg\icons\adg-curve.png"
351 Delete "$INSTDIR\share\adg\icons\adg-browsing.png"
352 Delete "$INSTDIR\share\adg\icons\adg-arc.png"
353 RMDir "$INSTDIR\share\adg\icons"
355 Delete "$INSTDIR\share\adg\adg-demo.ui"
356 Delete "$INSTDIR\share\adg\cpml-demo.ui"
357 Delete "$INSTDIR\share\adg\adg-128.png"
358 Delete "$INSTDIR\share\adg\adg-64.png"
359 Delete "$INSTDIR\share\adg\adg-48.png"
360 Delete "$INSTDIR\share\adg\adg-32.png"
361 Delete "$INSTDIR\share\adg\adg-16.png"
362 RMDir "$INSTDIR\share\adg"
364 Delete "$INSTDIR\share\glib-2.0\schemas\gschemas.compiled"
365 RMDir "$INSTDIR\share\glib-2.0\schemas"
366 RMDir "$INSTDIR\share\glib-2.0"
368 ; TODO: this should iterate over po/LINGUAS
369 !insertmacro DeleteLocale "it"
371 RMDir "$INSTDIR\share\locale"
372 RMDir /r "$INSTDIR\share\gtk-doc\html\cpml"
373 RMDir /r "$INSTDIR\share\gtk-doc\html\adg"
374 RMDir "$INSTDIR\share\gtk-doc\html"
376 Delete "$INSTDIR\share\gtk-doc\adg.pdf"
377 Delete "$INSTDIR\share\gtk-doc\cpml.pdf"
378 RMDir "$INSTDIR\share\gtk-doc"
380 RMDir /r "$INSTDIR\share\icons"
382 SetOutPath "$INSTDIR\share\gir-1.0"
383 Delete "$INSTDIR\share\gir-1.0\Atk-1.0.gir"
384 Delete "$INSTDIR\share\gir-1.0\GLib-2.0.gir"
385 Delete "$INSTDIR\share\gir-1.0\GModule-2.0.gir"
386 Delete "$INSTDIR\share\gir-1.0\GObject-2.0.gir"
387 Delete "$INSTDIR\share\gir-1.0\Gdk-3.0.gir"
388 Delete "$INSTDIR\share\gir-1.0\GdkPixbuf-2.0.gir"
389 Delete "$INSTDIR\share\gir-1.0\GdkWin32-3.0.gir"
390 Delete "$INSTDIR\share\gir-1.0\Gio-2.0.gir"
391 Delete "$INSTDIR\share\gir-1.0\Gtk-3.0.gir"
392 Delete "$INSTDIR\share\gir-1.0\HarfBuzz-0.0.gir"
393 Delete "$INSTDIR\share\gir-1.0\Pango-1.0.gir"
394 Delete "$INSTDIR\share\gir-1.0\PangoCairo-1.0.gir"
395 Delete "$INSTDIR\share\gir-1.0\PangoFT2-1.0.gir"
396 Delete "$INSTDIR\share\gir-1.0\cairo-1.0.gir"
397 Delete "$INSTDIR\share\gir-1.0\fontconfig-2.0.gir"
398 Delete "$INSTDIR\share\gir-1.0\freetype2-2.0.gir"
399 Delete "$INSTDIR\share\gir-1.0\win32-1.0.gir"
400 RMDir "$INSTDIR\share\gir-1.0"
402 Delete "$INSTDIR\share\lua\5.2\lgi.lua"
403 RMDir /r "$INSTDIR\share\lua\5.2\lgi"
404 RMDir "$INSTDIR\share\lua\5.2"
405 RMDir "$INSTDIR\share\lua"
407 RMDir "$INSTDIR\share"
409 Delete "$INSTDIR\etc\gtk-3.0\settings.ini"
410 RMDir "$INSTDIR\etc\gtk-3.0"
411 RMDir "$INSTDIR\etc"
413 Delete "$INSTDIR\adg-demo.exe"
414 Delete "$INSTDIR\cpml-demo.exe"
415 Delete "$INSTDIR\uninstall.exe"
416 RMDir "$INSTDIR"
418 ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\bin"
419 SectionEnd
422 ; ---------------------------------------------------------------
423 ; 7. Internationalization
425 !include "${SRCDIR}/build/Translations.nsh"
427 Function .onInit
428 !insertmacro MUI_LANGDLL_DISPLAY
429 FunctionEnd
431 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
432 !insertmacro MUI_DESCRIPTION_TEXT ${SecBase} $(DESC_SecBase)
433 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(DESC_SecLanguages)
434 !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} $(DESC_SecDocumentation)
435 !insertmacro MUI_DESCRIPTION_TEXT ${SecHTML} $(DESC_SecHTML)
436 !insertmacro MUI_DESCRIPTION_TEXT ${SecPDF} $(DESC_SecPDF)
437 !insertmacro MUI_FUNCTION_DESCRIPTION_END