adg: improve AdgContainer doc
[adg.git] / build / adg.nsi
blob5093f35054c9ef99a662774137e772bcd05699a7
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 "${USRDIR}/bin"
92 Section $(TITLE_SecBase) SecBase
93 SectionIn RO
95 SetOutPath "$INSTDIR"
96 File /oname=adg-demo.exe "${BUILDDIR}/demo/.libs/adg-demo-uninstalled.exe"
97 File /oname=cpml-demo.exe "${BUILDDIR}/demo/.libs/cpml-demo-uninstalled.exe"
99 SetOutPath "$INSTDIR\share\adg"
100 File "${BUILDDIR}/demo/adg-demo.ui"
101 File "${BUILDDIR}/demo/cpml-demo.ui"
102 File "${SRCDIR}/demo/adg-16.png"
103 File "${SRCDIR}/demo/adg-32.png"
104 File "${SRCDIR}/demo/adg-48.png"
105 File "${SRCDIR}/demo/adg-64.png"
106 File "${SRCDIR}/demo/adg-128.png"
108 SetOutPath "$INSTDIR\share\adg\icons"
109 File "${SRCDIR}/demo/icons/adg-arc.png"
110 File "${SRCDIR}/demo/icons/adg-browsing.png"
111 File "${SRCDIR}/demo/icons/adg-curve.png"
112 File "${SRCDIR}/demo/icons/adg-intersection.png"
113 File "${SRCDIR}/demo/icons/adg-segment.png"
115 SetOutPath "$INSTDIR\bin"
116 File "${DLLDIR}/libwinpthread-*.dll"
117 File "${DLLDIR}/libgcc_*-*.dll"
118 File "${DLLDIR}/zlib1.dll"
119 File "${DLLDIR}/libbz2-*.dll"
120 File "${DLLDIR}/libexpat-*.dll"
121 File "${DLLDIR}/libintl-*.dll"
122 File "${DLLDIR}/iconv.dll"
123 File "${DLLDIR}/libffi-*.dll"
124 File "${DLLDIR}/libpng*-*.dll"
125 File "${DLLDIR}/libglib-2.0-*.dll"
126 File "${DLLDIR}/libgthread-2.0-*.dll"
127 File "${DLLDIR}/libgmodule-2.0-*.dll"
128 File "${DLLDIR}/libgobject-2.0-*.dll"
129 File "${DLLDIR}/libgio-2.0-*.dll"
130 File "${DLLDIR}/libfreetype-*.dll"
131 File "${DLLDIR}/libpixman-1-*.dll"
132 File "${DLLDIR}/libcairo-*.dll"
133 File "${DLLDIR}/libcairo-gobject-*.dll"
134 File "${DLLDIR}/libpango-1.0-*.dll"
135 File "${DLLDIR}/libpangocairo-1.0-*.dll"
136 File "${DLLDIR}/libpangowin32-1.0-*.dll"
137 File "${DLLDIR}/libatk-1.0-*.dll"
138 File "${DLLDIR}/libgdk_pixbuf-2.0-*.dll"
139 File "${DLLDIR}/libgdk-3-*.dll"
140 File "${DLLDIR}/libgtk-3-*.dll"
141 File "${BUILDDIR}/src/cpml/.libs/libcpml-1-*.dll"
142 File "${BUILDDIR}/src/adg/.libs/libadg-1-*.dll"
144 SetOutPath "$INSTDIR\share\glib-2.0\schemas"
145 File "${SRCDIR}/build/gschemas.compiled"
147 SetOutPath "$INSTDIR\share\icons"
148 File /r "${BUILDDIR}/_host/hicolor"
149 File /r "${BUILDDIR}/_host/minitheme"
151 SetOutPath "$INSTDIR\etc\gtk-3.0"
152 File "${SRCDIR}/build/settings.ini"
154 CreateDirectory "$SMPROGRAMS\ADG Canvas"
155 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG demonstration program.lnk" '"$INSTDIR\adg-demo.exe"'
156 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk" '"$INSTDIR\cpml-demo.exe"'
158 WriteUninstaller "$INSTDIR\uninstall.exe"
159 ${EnvVarUpdate} $0 "PATH" "A" "HKCU" "$INSTDIR\bin"
160 SectionEnd
162 Function .onInstSuccess
163 ; The uninstall shortcut is installed inside onInstSuccess so any subsequent
164 ; section (e.g. SecHTML) can install other shortcuts *before* this one.
165 CreateShortcut "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk" "$INSTDIR\uninstall.exe"
166 FunctionEnd
168 ; II. Language support
170 !include "${SRCDIR}/build/Locale.nsh"
172 Section $(TITLE_SecLanguages) SecLanguages
173 ; TODO: this should iterate over po/LINGUAS
174 !insertmacro FileLocale "it"
175 SectionEnd
177 ; III. Documentation
179 SectionGroup /e $(TITLE_SecDocumentation) SecDocumentation
181 Section $(TITLE_SecHTML) SecHTML
182 SetOutPath "$INSTDIR\share\gtk-doc\html\cpml"
183 File /r "${BUILDDIR}/_host/docs/cpml/html/*.*"
185 SetOutPath "$INSTDIR\share\gtk-doc\html\adg"
186 File /r "${BUILDDIR}/_host/docs/adg/html/*.*"
188 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\cpml\index.html"'
189 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk" '"$INSTDIR\share\gtk-doc\html\adg\index.html"'
190 SectionEnd
192 Section /o $(TITLE_SecPDF) SecPDF
193 SetOutPath "$INSTDIR\share\gtk-doc"
194 File /r "${BUILDDIR}/_host/docs/cpml/cpml.pdf"
195 File /r "${BUILDDIR}/_host/docs/adg/adg.pdf"
197 CreateShortcut "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk" '"$INSTDIR\share\gtk-doc\cpml.pdf"'
198 CreateShortcut "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk" '"$INSTDIR\share\gtk-doc\adg.pdf"'
199 SectionEnd
201 SectionGroupEnd
203 ; IV. Uninstaller
205 Section "Uninstall"
206 Delete "$SMPROGRAMS\ADG Canvas\ADG Demonstration program.lnk"
207 Delete "$SMPROGRAMS\ADG Canvas\CPML showcase.lnk"
208 Delete "$SMPROGRAMS\ADG Canvas\CPML HTML manual.lnk"
209 Delete "$SMPROGRAMS\ADG Canvas\CPML PDF manual.lnk"
210 Delete "$SMPROGRAMS\ADG Canvas\ADG HTML manual.lnk"
211 Delete "$SMPROGRAMS\ADG Canvas\ADG PDF manual.lnk"
212 Delete "$SMPROGRAMS\ADG Canvas\Uninstall ADG Canvas.lnk"
213 RMDir "$SMPROGRAMS\ADG Canvas"
215 Delete "$INSTDIR\bin\libgtk-3-*.dll"
216 Delete "$INSTDIR\bin\libgdk-3-*.dll"
217 Delete "$INSTDIR\bin\libgdk_pixbuf-2.0-*.dll"
218 Delete "$INSTDIR\bin\libatk-1.0-*.dll"
219 Delete "$INSTDIR\bin\libpangowin32-1.0-*.dll"
220 Delete "$INSTDIR\bin\libpangocairo-1.0-*.dll"
221 Delete "$INSTDIR\bin\libpango-1.0-*.dll"
222 Delete "$INSTDIR\bin\libcairo-gobject-*.dll"
223 Delete "$INSTDIR\bin\libcairo-*.dll"
224 Delete "$INSTDIR\bin\libpixman-1-*.dll"
225 Delete "$INSTDIR\bin\libfreetype-*.dll"
226 Delete "$INSTDIR\bin\libgio-2.0-*.dll"
227 Delete "$INSTDIR\bin\libgobject-2.0-*.dll"
228 Delete "$INSTDIR\bin\libgmodule-2.0-*.dll"
229 Delete "$INSTDIR\bin\libgthread-2.0-*.dll"
230 Delete "$INSTDIR\bin\libglib-2.0-*.dll"
231 Delete "$INSTDIR\bin\libpng*-*.dll"
232 Delete "$INSTDIR\bin\libffi-*.dll"
233 Delete "$INSTDIR\bin\iconv.dll"
234 Delete "$INSTDIR\bin\libintl-*.dll"
235 Delete "$INSTDIR\bin\libexpat-*.dll"
236 Delete "$INSTDIR\bin\libbz2-*.dll"
237 Delete "$INSTDIR\bin\zlib1.dll"
238 Delete "$INSTDIR\bin\libgcc_*-*.dll"
239 Delete "$INSTDIR\bin\libwinpthread-*.dll"
240 Delete "$INSTDIR\bin\libcpml-1-*.dll"
241 Delete "$INSTDIR\bin\libadg-1-*.dll"
242 RMDir "$INSTDIR\bin"
244 Delete "$INSTDIR\share\adg\icons\adg-segment.png"
245 Delete "$INSTDIR\share\adg\icons\adg-intersection.png"
246 Delete "$INSTDIR\share\adg\icons\adg-curve.png"
247 Delete "$INSTDIR\share\adg\icons\adg-browsing.png"
248 Delete "$INSTDIR\share\adg\icons\adg-arc.png"
249 RMDir "$INSTDIR\share\adg\icons"
251 Delete "$INSTDIR\share\adg\adg-demo.ui"
252 Delete "$INSTDIR\share\adg\cpml-demo.ui"
253 Delete "$INSTDIR\share\adg\adg-128.png"
254 Delete "$INSTDIR\share\adg\adg-64.png"
255 Delete "$INSTDIR\share\adg\adg-48.png"
256 Delete "$INSTDIR\share\adg\adg-32.png"
257 Delete "$INSTDIR\share\adg\adg-16.png"
258 RMDir "$INSTDIR\share\adg"
260 Delete "$INSTDIR\share\glib-2.0\schemas\gschemas.compiled"
261 RMDir "$INSTDIR\share\glib-2.0\schemas"
262 RMDir "$INSTDIR\share\glib-2.0"
264 ; TODO: this should iterate over po/LINGUAS
265 !insertmacro DeleteLocale "it"
267 RMDir "$INSTDIR\share\locale"
268 RMDir /r "$INSTDIR\share\gtk-doc\html\cpml"
269 RMDir /r "$INSTDIR\share\gtk-doc\html\adg"
270 RMDir "$INSTDIR\share\gtk-doc\html"
272 Delete "$INSTDIR\share\gtk-doc\adg.pdf"
273 Delete "$INSTDIR\share\gtk-doc\cpml.pdf"
274 RMDir "$INSTDIR\share\gtk-doc"
276 RMDir /r "$INSTDIR\share\icons"
277 RMDir "$INSTDIR\share"
279 Delete "$INSTDIR\etc\gtk-3.0\settings.ini"
280 RMDir "$INSTDIR\etc\gtk-3.0"
281 RMDir "$INSTDIR\etc"
283 Delete "$INSTDIR\adg-demo.exe"
284 Delete "$INSTDIR\cpml-demo.exe"
285 Delete "$INSTDIR\uninstall.exe"
286 RMDir "$INSTDIR"
288 ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\bin"
289 SectionEnd
292 ; ---------------------------------------------------------------
293 ; 7. Internationalization
295 !include "${SRCDIR}/build/Translations.nsh"
297 Function .onInit
298 !insertmacro MUI_LANGDLL_DISPLAY
299 FunctionEnd
301 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
302 !insertmacro MUI_DESCRIPTION_TEXT ${SecBase} $(DESC_SecBase)
303 !insertmacro MUI_DESCRIPTION_TEXT ${SecLanguages} $(DESC_SecLanguages)
304 !insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} $(DESC_SecDocumentation)
305 !insertmacro MUI_DESCRIPTION_TEXT ${SecHTML} $(DESC_SecHTML)
306 !insertmacro MUI_DESCRIPTION_TEXT ${SecPDF} $(DESC_SecPDF)
307 !insertmacro MUI_FUNCTION_DESCRIPTION_END