fixup! fixup! fixup! fixup! Add /NOSERVER option to Windows installer to not install...
[dcpomatic.git] / platform / windows / wscript
1 from __future__ import print_function
2 import os
3
4 def write_installer(bits, dcpomatic_version, debug, disk):
5
6     tools = [
7         ('batch', 'Batch Converter'),
8         ('kdm', 'KDM Creator'),
9         ('kdm_cli', 'KDM Creator CLI'),
10         ('player', 'Player'),
11         ('cli', 'CLI'),
12         ('create', 'Creator'),
13         ('playlist', 'Playlist Editor'),
14         ('combiner', 'Combiner'),
15         ('editor', 'Editor'),
16     ]
17
18     if disk:
19         tools.append(('disk', 'Disk Writer'))
20
21     # It would be nice to use exist_ok here but it requires quite a new python
22     try:
23         os.makedirs('build/platform/windows')
24     except:
25         pass
26
27     filename = 'build/platform/windows/installer.%d.nsi' % bits
28
29     f = open(filename, 'w')
30     print('!include "MUI2.nsh"', file=f)
31     if bits == 64:
32         print('!include "x64.nsh"', file=f)
33
34     if debug:
35         print('Name "DCP-o-matic debug"', file=f)
36     else:
37         print('Name "DCP-o-matic"', file=f)
38
39     print('RequestExecutionLevel admin', file=f)
40
41     outfile = 'DCP-o-matic '
42     if debug:
43         outfile += 'Debug '
44     outfile += '%s %d-bit Installer.exe' % (dcpomatic_version, bits)
45
46     print('outFile "%s"' % outfile, file=f)
47
48     print("""
49 !define MUI_ICON "%graphics%/windows/dcpomatic2.ico"
50 !define MUI_UNICON "%graphics%/windows/dcpomatic2.ico"
51 !define MUI_SPECIALBITMAP "%graphics%/windows/dcpomatic.bmp"
52 !include "Sections.nsh"
53     """, file=f)
54
55     if bits == 64:
56         program_files = "$PROGRAMFILES64"
57     else:
58         program_files = "$PROGRAMFILES"
59
60     if debug:
61         print('InstallDir "%s\\DCP-o-matic 2 debug"' % program_files, file=f)
62     else:
63         print('InstallDir "%s\\DCP-o-matic 2"' % program_files, file=f)
64
65     print("""
66 !insertmacro MUI_PAGE_WELCOME
67 !insertmacro MUI_PAGE_LICENSE "../../../COPYING"
68 !insertmacro MUI_PAGE_DIRECTORY
69 !insertmacro MUI_PAGE_COMPONENTS
70
71 !define SF_USELECTED  0
72
73 !macro SecUnSelect SecId
74   Push $0
75   IntOp $0 ${SF_USELECTED} | ${SF_RO}
76   SectionSetFlags "${SecId}" "$0"
77   SectionSetText  "${SecId}" ""
78   Pop $0
79 !macroend
80  
81 !define UnSelectSection '!insertmacro SecUnSelect'
82
83 Function GetOptions
84         !define GetOptions `!insertmacro GetOptionsCall`
85  
86         !macro GetOptionsCall _PARAMETERS _OPTION _RESULT
87                 Push `${_PARAMETERS}`
88                 Push `${_OPTION}`
89                 Call GetOptions
90                 Pop ${_RESULT}
91         !macroend
92  
93         Exch $1
94         Exch
95         Exch $0
96         Exch
97         Push $2
98         Push $3
99         Push $4
100         Push $5
101         Push $6
102         Push $7
103         ClearErrors
104  
105         StrCpy $2 $1 '' 1
106         StrCpy $1 $1 1
107         StrLen $3 $2
108         StrCpy $7 0
109  
110         begin:
111         StrCpy $4 -1
112         StrCpy $6 ''
113  
114         quote:
115         IntOp $4 $4 + 1
116         StrCpy $5 $0 1 $4
117         StrCmp $5$7 '0' notfound
118         StrCmp $5 '' trimright
119         StrCmp $5 '"' 0 +7
120         StrCmp $6 '' 0 +3
121         StrCpy $6 '"'
122         goto quote
123         StrCmp $6 '"' 0 +3
124         StrCpy $6 ''
125         goto quote
126         StrCmp $5 `'` 0 +7
127         StrCmp $6 `` 0 +3
128         StrCpy $6 `'`
129         goto quote
130         StrCmp $6 `'` 0 +3
131         StrCpy $6 ``
132         goto quote
133         StrCmp $5 '`' 0 +7
134         StrCmp $6 '' 0 +3
135         StrCpy $6 '`'
136         goto quote
137         StrCmp $6 '`' 0 +3
138         StrCpy $6 ''
139         goto quote
140         StrCmp $6 '"' quote
141         StrCmp $6 `'` quote
142         StrCmp $6 '`' quote
143         StrCmp $5 $1 0 quote
144         StrCmp $7 0 trimleft trimright
145  
146         trimleft:
147         IntOp $4 $4 + 1
148         StrCpy $5 $0 $3 $4
149         StrCmp $5 '' notfound
150         StrCmp $5 $2 0 quote
151         IntOp $4 $4 + $3
152         StrCpy $0 $0 '' $4
153         StrCpy $4 $0 1
154         StrCmp $4 ' ' 0 +3
155         StrCpy $0 $0 '' 1
156         goto -3
157         StrCpy $7 1
158         goto begin
159  
160         trimright:
161         StrCpy $0 $0 $4
162         StrCpy $4 $0 1 -1
163         StrCmp $4 ' ' 0 +3
164         StrCpy $0 $0 -1
165         goto -3
166         StrCpy $3 $0 1
167         StrCpy $4 $0 1 -1
168         StrCmp $3 $4 0 end
169         StrCmp $3 '"' +3
170         StrCmp $3 `'` +2
171         StrCmp $3 '`' 0 end
172         StrCpy $0 $0 -1 1
173         goto end
174  
175         notfound:
176         SetErrors
177         StrCpy $0 ''
178  
179         end:
180         Pop $7
181         Pop $6
182         Pop $5
183         Pop $4
184         Pop $3
185         Pop $2
186         Pop $1
187         Exch $0
188 FunctionEnd
189
190 Function .onInit
191 ${GetOptions} $R0 /NOSERVER= $0
192 ${If} $0 == "1"
193   ${UnSelectSection} "Encode server"
194 ${Endif}
195 FunctionEnd
196
197 Section "Common files (required)" SEC_COMMON
198 SectionIn RO
199     """, file=f)
200
201     if bits == 64:
202         print("""
203 ; disable registry redirection (enable access to 64-bit portion of registry)
204 SetRegView 64
205         """, file=f)
206
207     print("""
208 SetOutPath "$INSTDIR\\bin"
209 WriteUninstaller "$INSTDIR\\Uninstall.exe"
210
211 File "%static_deps%/bin/libintl-8.dll"
212 """, file=f)
213
214     for lib in ['chrono', 'filesystem', 'system', 'thread', 'date_time', 'locale', 'regex']:
215         print('File "%%static_deps%%/bin/libboost_%s-mt-x%d.dll"' % (lib, bits), file=f)
216
217     if bits == 32:
218         print('File "%static_deps%/bin/libgcc_s_sjlj-1.dll"', file=f)
219     else:
220         print('File "%static_deps%/bin/libgcc_s_seh-1.dll"', file=f)
221
222     print("""
223 File "%static_deps%/bin/libgio-2.0-0.dll"
224 File "%static_deps%/bin/libglib-2.0-0.dll"
225 File "%static_deps%/bin/libgobject-2.0-0.dll"
226 File "%static_deps%/bin/libiconv-2.dll"
227 File "%static_deps%/bin/libjpeg-9.dll"
228 File "%static_deps%/bin/libpng16-16.dll"
229 File "%static_deps%/bin/libsigc-2.0-0.dll"
230 File "%static_deps%/bin/libsndfile-1.dll"
231 File "%static_deps%/bin/libssh.dll"
232 File "%static_deps%/bin/libstdc++-6.dll"
233 File "%static_deps%/bin/zlib1.dll"
234 File "%static_deps%/bin/libjpeg-9.dll"
235 File "%static_deps%/bin/wxbase314u_gcc_custom.dll"
236 File "%static_deps%/bin/wxmsw314u_core_gcc_custom.dll"
237 File "%static_deps%/bin/wxmsw314u_adv_gcc_custom.dll"
238 File "%static_deps%/bin/wxmsw314u_richtext_gcc_custom.dll"
239 File "%static_deps%/bin/wxmsw314u_html_gcc_custom.dll"
240 File "%static_deps%/bin/wxmsw314u_gl_gcc_custom.dll"
241 File "%static_deps%/bin/wxmsw314u_propgrid_gcc_custom.dll"
242 File "%static_deps%/bin/wxbase314u_xml_gcc_custom.dll"
243 File "%static_deps%/bin/libcairo-2.dll"
244 File "%static_deps%/bin/libfreetype-6.dll"
245 File "%static_deps%/bin/libgthread-2.0-0.dll"
246 File "%static_deps%/bin/libpango-1.0-0.dll"
247 File "%static_deps%/bin/libgmodule-2.0-0.dll"
248 File "%static_deps%/bin/libpangocairo-1.0-0.dll"
249 File "%static_deps%/bin/libpangowin32-1.0-0.dll"
250 File "%static_deps%/bin/libtiff-5.dll"
251 File "%static_deps%/bin/libglibmm-2.4-1.dll"
252 File "%static_deps%/bin/libxml++-2.6-2.dll"
253 File "%static_deps%/bin/libxml2-2.dll"
254 File "%static_deps%/bin/libpixman-1-0.dll"
255 File "%static_deps%/bin/libfontconfig-1.dll"
256 File "%static_deps%/bin/libexpat-1.dll"
257 File "%static_deps%/bin/libbz2.dll"
258 File "%static_deps%/bin/libxmlsec1.dll"
259 File "%static_deps%/bin/libxmlsec1-openssl.dll"
260 File "%static_deps%/bin/libexslt-0.dll"
261 File "%static_deps%/bin/libxslt-1.dll"
262 File "%static_deps%/bin/libffi-6.dll"
263 File "%static_deps%/bin/openssl.exe"
264 File "%static_deps%/bin/libcurl-4.dll"
265 File "%static_deps%/bin/libzip.dll"
266 File "%static_deps%/bin/libcairomm-1.0-1.dll"
267 File "%static_deps%/bin/libpangomm-1.4-1.dll"
268 File "%static_deps%/bin/libsamplerate-0.dll"
269 File "%static_deps%/bin/libnettle-8.dll"
270 File "%static_deps%/bin/icuuc66.dll"
271 File "%static_deps%/bin/icudt66.dll"
272 File "%static_deps%/bin/icuin66.dll"
273 File "%static_deps%/bin/liblzma-5.dll"
274 File "%static_deps%/bin/libpcre-1.dll"
275 File "%static_deps%/bin/libharfbuzz-0.dll"
276 File "%static_deps%/bin/libwinpthread-1.dll"
277 File "%static_deps%/bin/libgnutls-30.dll"
278 File "%static_deps%/bin/libgmp-10.dll"
279 File "%static_deps%/bin/libhogweed-6.dll"
280 File "%static_deps%/bin/libidn2-0.dll"
281 File "%static_deps%/bin/libunistring-2.dll"
282 File "%static_deps%/bin/libssh2-1.dll"
283 File "%static_deps%/bin/libgcrypt-20.dll"
284 File "%static_deps%/bin/libgpg-error-0.dll"
285 File "%static_deps%/bin/libpangoft2-1.0-0.dll"
286 File "%static_deps%/bin/libx264-155.dll"
287 File "%static_deps%/bin/libwebp-7.dll"
288 File "%static_deps%/bin/GLEW.dll"
289 File "%static_deps%/bin/libdav1d.dll"
290     """, file=f)
291
292     if bits == 32:
293         print('File "%static_deps%/bin/libcrypto-3.dll"', file=f)
294     else:
295         print('File "%static_deps%/bin/libcrypto-3-x64.dll"', file=f)
296
297     print("""
298 File "%static_deps%/bin/libltdl-7.dll"
299 File "%static_deps%/bin/libdl.dll"
300 File /oname=dcpomatic2_verify.exe "%cdist_deps%/bin/dcpverify.exe"
301 File "%cdist_deps%/bin/leqm_nrt.dll"
302 File "%cdist_deps%/bin/asdcp-carl.dll"
303 File "%cdist_deps%/bin/kumu-carl.dll"
304     """, file=f)
305
306     if disk:
307         print("""
308 File "%static_deps%/bin/libnanomsg.dll"
309 File "%cdist_deps%/lib/libblockdev.dll"
310 File "%cdist_deps%/lib/liblwext4.dll"
311         """, file=f)
312
313     print("""
314 File "%cdist_deps%/bin/avcodec-58.dll"
315 File "%cdist_deps%/bin/avfilter-7.dll"
316 File "%cdist_deps%/bin/avformat-58.dll"
317 File "%cdist_deps%/bin/avutil-56.dll"
318 File "%cdist_deps%/bin/avdevice-58.dll"
319 File "%cdist_deps%/bin/postproc-55.dll"
320 File "%cdist_deps%/bin/swresample-3.dll"
321 File "%cdist_deps%/bin/swscale-5.dll"
322 File "%cdist_deps%/bin/dcp-1.0.dll"
323 File "%cdist_deps%/bin/cxml-0.dll"
324 File "%cdist_deps%/bin/sub-1.0.dll"
325 File "%cdist_deps%/bin/ffprobe.exe"
326 File "%cdist_deps%/src/openssl/apps/openssl.exe"
327 File "%cdist_deps%/bin/libopenjp2.dll"
328     """, file=f)
329
330     if debug:
331         print('File "%resources%/gdb_script"', file=f)
332         print('File "%resources%/dcpomatic2_debug.bat"', file=f)
333         print('File "%mingw%/bin/gdb.exe"', file=f)
334         print('File "%static_deps%/bin/libtermcap.dll"', file=f)
335         print('File "%static_deps%/bin/libreadline8.dll"', file=f)
336         print('File "%static_deps%/bin/libmman.dll"', file=f)
337         for s, l in tools:
338             print('File "%%resources%%/dcpomatic2_%s_debug.bat"' % s, file=f)
339     else:
340         print('File "%binaries%/src/wx/dcpomatic2-wx.dll"', file=f)
341         print('File "%binaries%/src/lib/dcpomatic2.dll"', file=f)
342
343     print("""
344 SetOutPath "$INSTDIR\\bin"
345
346 SetOutPath "$INSTDIR\\locale\\fr\\LC_MESSAGES"
347 File "%binaries%/src/lib/mo/fr_FR/libdcpomatic2.mo"
348 File "%binaries%/src/wx/mo/fr_FR/libdcpomatic2-wx.mo"
349 File "%binaries%/src/tools/mo/fr_FR/dcpomatic2.mo"
350 File "%static_deps%/share/locale/fr/LC_MESSAGES/wxstd.mo"
351 SetOutPath "$INSTDIR\\locale\\it\\LC_MESSAGES"
352 File "%binaries%/src/lib/mo/it_IT/libdcpomatic2.mo"
353 File "%binaries%/src/wx/mo/it_IT/libdcpomatic2-wx.mo"
354 File "%binaries%/src/tools/mo/it_IT/dcpomatic2.mo"
355 File "%static_deps%/share/locale/it/LC_MESSAGES/wxstd.mo"
356 SetOutPath "$INSTDIR\\locale\\es\\LC_MESSAGES"
357 File "%binaries%/src/lib/mo/es_ES/libdcpomatic2.mo"
358 File "%binaries%/src/wx/mo/es_ES/libdcpomatic2-wx.mo"
359 File "%binaries%/src/tools/mo/es_ES/dcpomatic2.mo"
360 File "%static_deps%/share/locale/es/LC_MESSAGES/wxstd.mo"
361 SetOutPath "$INSTDIR\\locale\\sv\\LC_MESSAGES"
362 File "%binaries%/src/lib/mo/sv_SE/libdcpomatic2.mo"
363 File "%binaries%/src/wx/mo/sv_SE/libdcpomatic2-wx.mo"
364 File "%binaries%/src/tools/mo/sv_SE/dcpomatic2.mo"
365 File "%static_deps%/share/locale/sv/LC_MESSAGES/wxstd.mo"
366 SetOutPath "$INSTDIR\\locale\\de\\LC_MESSAGES"
367 File "%binaries%/src/lib/mo/de_DE/libdcpomatic2.mo"
368 File "%binaries%/src/wx/mo/de_DE/libdcpomatic2-wx.mo"
369 File "%binaries%/src/tools/mo/de_DE/dcpomatic2.mo"
370 File "%static_deps%/share/locale/de/LC_MESSAGES/wxstd.mo"
371 SetOutPath "$INSTDIR\\locale\\nl\\LC_MESSAGES"
372 File "%binaries%/src/lib/mo/nl_NL/libdcpomatic2.mo"
373 File "%binaries%/src/wx/mo/nl_NL/libdcpomatic2-wx.mo"
374 File "%binaries%/src/tools/mo/nl_NL/dcpomatic2.mo"
375 File "%static_deps%/share/locale/nl/LC_MESSAGES/wxstd.mo"
376 SetOutPath "$INSTDIR\\locale\\ru\\LC_MESSAGES"
377 File "%binaries%/src/lib/mo/ru_RU/libdcpomatic2.mo"
378 File "%binaries%/src/wx/mo/ru_RU/libdcpomatic2-wx.mo"
379 File "%binaries%/src/tools/mo/ru_RU/dcpomatic2.mo"
380 File "%static_deps%/share/locale/ru/LC_MESSAGES/wxstd.mo"
381 SetOutPath "$INSTDIR\\locale\\pl\\LC_MESSAGES"
382 File "%binaries%/src/lib/mo/pl_PL/libdcpomatic2.mo"
383 File "%binaries%/src/wx/mo/pl_PL/libdcpomatic2-wx.mo"
384 File "%binaries%/src/tools/mo/pl_PL/dcpomatic2.mo"
385 File "%static_deps%/share/locale/pl/LC_MESSAGES/wxstd.mo"
386 SetOutPath "$INSTDIR\\locale\\da\\LC_MESSAGES"
387 File "%binaries%/src/lib/mo/da_DK/libdcpomatic2.mo"
388 File "%binaries%/src/wx/mo/da_DK/libdcpomatic2-wx.mo"
389 File "%binaries%/src/tools/mo/da_DK/dcpomatic2.mo"
390 File "%static_deps%/share/locale/da/LC_MESSAGES/wxstd.mo"
391 SetOutPath "$INSTDIR\\locale\\pt_PT\\LC_MESSAGES"
392 File "%binaries%/src/lib/mo/pt_PT/libdcpomatic2.mo"
393 File "%binaries%/src/wx/mo/pt_PT/libdcpomatic2-wx.mo"
394 File "%binaries%/src/tools/mo/pt_PT/dcpomatic2.mo"
395 SetOutPath "$INSTDIR\\locale\\pt_BR\\LC_MESSAGES"
396 File "%binaries%/src/lib/mo/pt_BR/libdcpomatic2.mo"
397 File "%binaries%/src/wx/mo/pt_BR/libdcpomatic2-wx.mo"
398 File "%binaries%/src/tools/mo/pt_BR/dcpomatic2.mo"
399 SetOutPath "$INSTDIR\\locale\\sk\\LC_MESSAGES"
400 File "%binaries%/src/lib/mo/sk_SK/libdcpomatic2.mo"
401 File "%binaries%/src/wx/mo/sk_SK/libdcpomatic2-wx.mo"
402 File "%binaries%/src/tools/mo/sk_SK/dcpomatic2.mo"
403 SetOutPath "$INSTDIR\\locale\\cs\\LC_MESSAGES"
404 File "%binaries%/src/lib/mo/cs_CZ/libdcpomatic2.mo"
405 File "%binaries%/src/wx/mo/cs_CZ/libdcpomatic2-wx.mo"
406 File "%binaries%/src/tools/mo/cs_CZ/dcpomatic2.mo"
407 File "%static_deps%/share/locale/cs/LC_MESSAGES/wxstd.mo"
408 SetOutPath "$INSTDIR\\locale\\uk\\LC_MESSAGES"
409 File "%binaries%/src/lib/mo/uk_UA/libdcpomatic2.mo"
410 File "%binaries%/src/wx/mo/uk_UA/libdcpomatic2-wx.mo"
411 File "%binaries%/src/tools/mo/uk_UA/dcpomatic2.mo"
412 SetOutPath "$INSTDIR\\locale\\zh_cn\\LC_MESSAGES"
413 File "%binaries%/src/lib/mo/zh_CN/libdcpomatic2.mo"
414 File "%binaries%/src/wx/mo/zh_CN/libdcpomatic2-wx.mo"
415 File "%binaries%/src/tools/mo/zh_CN/dcpomatic2.mo"
416 SetOutPath "$INSTDIR\\locale\\tr_tr\\LC_MESSAGES"
417 File "%binaries%/src/lib/mo/tr_TR/libdcpomatic2.mo"
418 File "%binaries%/src/wx/mo/tr_TR/libdcpomatic2-wx.mo"
419 File "%binaries%/src/tools/mo/tr_TR/dcpomatic2.mo"
420 SetOutPath "$INSTDIR\\locale\\sl_si\\LC_MESSAGES"
421 File "%binaries%/src/lib/mo/sl_SI/libdcpomatic2.mo"
422 File "%binaries%/src/wx/mo/sl_SI/libdcpomatic2-wx.mo"
423 File "%binaries%/src/tools/mo/sl_SI/dcpomatic2.mo"
424 SetOutPath "$INSTDIR\\locale\\hu_hu\\LC_MESSAGES"
425 File "%binaries%/src/lib/mo/hu_HU/libdcpomatic2.mo"
426 File "%binaries%/src/wx/mo/hu_HU/libdcpomatic2-wx.mo"
427 File "%binaries%/src/tools/mo/hu_HU/dcpomatic2.mo"
428
429 SetOutPath "$INSTDIR"
430 File "%resources%/../../fonts/LiberationSans-Regular.ttf"
431 File "%resources%/../../fonts/LiberationSans-Italic.ttf"
432 File "%resources%/../../fonts/LiberationSans-Bold.ttf"
433 File /oname=fonts.conf "%resources%/../../fonts/fonts.conf.windows"
434 File "%graphics%/splash.png"
435 File "%graphics%/zoom_white.png"
436 File "%graphics%/zoom_black.png"
437 File "%graphics%/zoom_all_white.png"
438 File "%graphics%/zoom_all_black.png"
439 File "%graphics%/select_white.png"
440 File "%graphics%/select_black.png"
441 File "%graphics%/snap_white.png"
442 File "%graphics%/snap_black.png"
443 File "%graphics%/sequence_white.png"
444 File "%graphics%/sequence_black.png"
445 File "%graphics%/me.jpg"
446 File "%graphics%/tick.png"
447 File "%graphics%/no_tick.png"
448 File "%graphics%/link.png"
449 SetOutPath "$INSTDIR\\xsd"
450 File "%cdist_deps%/share/libdcp/xsd/DCDMSubtitle-2010.xsd"
451 File "%cdist_deps%/share/libdcp/xsd/DCSubtitle.v1.mattsson.xsd"
452 File "%cdist_deps%/share/libdcp/xsd/Dolby-2012-AD.xsd"
453 File "%cdist_deps%/share/libdcp/xsd/isdcf-mca.xsd"
454 File "%cdist_deps%/share/libdcp/xsd/Main-Stereo-Picture-CPL.xsd"
455 File "%cdist_deps%/share/libdcp/xsd/PROTO-ASDCP-AM-20040311.xsd"
456 File "%cdist_deps%/share/libdcp/xsd/PROTO-ASDCP-CC-CPL-20070926.xsd"
457 File "%cdist_deps%/share/libdcp/xsd/PROTO-ASDCP-CPL-20040511.xsd"
458 File "%cdist_deps%/share/libdcp/xsd/PROTO-ASDCP-PKL-20040311.xsd"
459 File "%cdist_deps%/share/libdcp/xsd/SMPTE-335-2012.xsd"
460 File "%cdist_deps%/share/libdcp/xsd/SMPTE-395-2014-13-1-aaf.xsd"
461 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-10-2008.xsd"
462 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-12-2008.xsd"
463 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-16.xsd"
464 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-7-2006-CPL.xsd"
465 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-8-2006-PKL.xsd"
466 File "%cdist_deps%/share/libdcp/xsd/SMPTE-429-9-2007-AM.xsd"
467 File "%cdist_deps%/share/libdcp/xsd/xlink.xsd"
468 File "%cdist_deps%/share/libdcp/xsd/xmldsig-core-schema.xsd"
469 File "%cdist_deps%/share/libdcp/xsd/XMLSchema.dtd"
470 File "%cdist_deps%/share/libdcp/xsd/XMLSchema.xsd"
471 File "%cdist_deps%/share/libdcp/xsd/xml.xsd"
472 SetOutPath "$INSTDIR\\tags"
473 File "%cdist_deps%/share/libdcp/tags/extlang"
474 File "%cdist_deps%/share/libdcp/tags/language"
475 File "%cdist_deps%/share/libdcp/tags/region"
476 File "%cdist_deps%/share/libdcp/tags/script"
477 File "%cdist_deps%/share/libdcp/tags/variant"
478 File "%cdist_deps%/share/libdcp/tags/dcnc"
479 SetOutPath "$INSTDIR"
480 File "%cdist_deps%/share/libdcp/ratings"
481
482 SectionEnd
483     """, file=f)
484
485     if debug:
486         print('Section "DCP-o-matic 2 debug" SEC_MASTER', file=f)
487     else:
488         print('Section "DCP-o-matic 2" SEC_MASTER', file=f)
489
490     print('SetOutPath "$INSTDIR\\bin"', file=f)
491
492     if debug:
493         print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2 debug"', file=f)
494     else:
495         print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"', file=f)
496
497     print('File "%binaries%/src/tools/dcpomatic2.exe"', file=f)
498     for s, l in tools:
499         print('File "%%binaries%%/src/tools/dcpomatic2_%s.exe"' % s, file=f)
500
501     if disk:
502         print("""
503 File "%binaries%/src/tools/dcpomatic2_disk_writer.exe"
504 File "%resources%/dcpomatic2_disk_writer.exe.manifest"
505     """, file=f)
506
507     if debug:
508         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat"', file=f)
509         for s, l in tools:
510             print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 %s debug.lnk" "$INSTDIR\\bin\\dcpomatic2_%s_debug.bat" ""' % (l, s), file=f)
511         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\Uninstall DCP-o-matic 2 debug.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
512         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "DisplayName" "DCP-o-matic 2 debug (remove only)"', file=f)
513         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
514     else:
515         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe"', file=f)
516         for s, l in tools:
517             print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 %s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s.exe"' % (l, s), file=f)
518         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
519         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "DisplayName" "DCP-o-matic 2 (remove only)"', file=f)
520         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
521
522     print("SectionEnd", file=f)
523
524     if debug:
525         print('Section "DCP-o-matic 2 debug desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
526         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat" ""', file=f)
527         for s, l in tools:
528             print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 %s debug.lnk" "$INSTDIR\\bin\\dcpomatic2_%s_debug.bat" ""' % (l, s), file=f)
529     else:
530         print('Section "DCP-o-matic 2 desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
531         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe" ""', file=f)
532         for s, l in tools:
533             print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 %s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s.exe"' % (l, s), file=f)
534
535     print("SectionEnd", file=f)
536
537     print("""
538 Section "Encode server" SEC_SERVER
539 SetOutPath "$INSTDIR\\bin"
540 CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"
541 File "%binaries%/src/tools/dcpomatic2_server_cli.exe"
542 File "%binaries%/src/tools/dcpomatic2_server.exe"
543 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 Encode Server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" "" "$INSTDIR\\bin\\dcpomatic2_server.exe" 0
544 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0
545 SectionEnd
546 Section "Encode server desktop shortcuts" SEC_SERVER_DESKTOP
547 CreateShortCut "$DESKTOP\\DCP-o-matic 2 Encode Server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" ""
548 SectionEnd
549     """, file=f)
550
551     if debug:
552         print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2 debug"', file=f)
553         print('LangString DESC_SEC_MASTER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 debug desktop shortcuts"', file=f)
554     else:
555         print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2"', file=f)
556         print('LangString DESC_SEC_MASTER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 desktop shortcuts"', file=f)
557         print('LangString DESC_SEC_SERVER ${LANG_ENGLISH} "DCP-o-matic 2 Encode Server"', file=f)
558         print('LangString DESC_SEC_SERVER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 Encode Server desktop shortcuts"', file=f)
559
560     print("""
561 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
562 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER} $(DESC_SEC_MASTER)
563 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER_DESKTOP} $(DESC_SEC_MASTER_DESKTOP)
564 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER)
565 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER_DESKTOP} $(DESC_SEC_SERVER_DESKTOP)
566 !insertmacro MUI_FUNCTION_DESCRIPTION_END
567
568 !insertmacro MUI_PAGE_INSTFILES
569 !insertmacro MUI_PAGE_FINISH
570
571 !insertmacro MUI_UNPAGE_WELCOME
572 !insertmacro MUI_UNPAGE_CONFIRM
573 !insertmacro MUI_UNPAGE_INSTFILES
574 !insertmacro MUI_UNPAGE_FINISH
575 !insertmacro MUI_LANGUAGE "English"
576     """, file=f)
577
578     if debug:
579         print("""
580 Section "Uninstall"
581 RMDir /r "$INSTDIR\\*.*"
582 RMDir "$INSTDIR"
583 Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"
584         """, file=f)
585
586         for s, l in tools:
587             print('Delete "$DESKTOP\\DCP-o-matic 2 %s debug.lnk"' % l, file=f)
588
589         print("""
590 Delete "$SMPROGRAMS\\DCP-o-matic 2 debug\\*.*"
591 RmDir  "$SMPROGRAMS\\DCP-o-matic 2 debug"
592 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2 debug"
593 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug"
594  SectionEnd
595         """, file=f)
596     else:
597         print("""
598 Section "Uninstall"
599 RMDir /r "$INSTDIR\\*.*"
600 RMDir "$INSTDIR"
601 Delete "$DESKTOP\\DCP-o-matic 2.lnk"
602         """, file=f)
603
604         for s, l in tools:
605             print('Delete "$DESKTOP\\DCP-o-matic 2 %s.lnk"' % l)
606
607         print("""
608 Delete "$SMPROGRAMS\\DCP-o-matic 2\\*.*"
609 RmDir  "$SMPROGRAMS\\DCP-o-matic 2"
610 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2"
611 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2"
612  SectionEnd
613     """, file=f)
614
615
616 def build(bld):
617     write_installer(32, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK)
618     write_installer(64, bld.env.VERSION, bld.env.DEBUG, bld.env.ENABLE_DISK)