Add KDM creator to win32 debug version.
[dcpomatic.git] / platform / windows / wscript
1 from __future__ import print_function
2 import os
3
4 def write_installer(bits, windows_version, dcpomatic_version, debug):
5     try:
6         os.makedirs('build/platform/windows')
7     except:
8         pass
9
10     filename = 'build/platform/windows/installer.'
11     if windows_version is not None:
12         filename += 'xp.'
13     filename += '%d.nsi' % bits
14
15     f = open(filename, 'w')
16     print('!include "MUI2.nsh"', file=f)
17     if bits == 64:
18         print('!include "x64.nsh"', file=f)
19
20     if debug:
21         print('Name "DCP-o-matic debug"', file=f)
22     else:
23         print('Name "DCP-o-matic"', file=f)
24
25     print('RequestExecutionLevel admin', file=f)
26
27     outfile = 'DCP-o-matic '
28     if debug:
29         outfile += 'Debug '
30     outfile += '%s %d-bit ' % (dcpomatic_version, bits)
31     if windows_version is 'xp':
32         outfile += 'XP '
33     outfile += 'Installer.exe'
34
35     print('outFile "%s"' % outfile, file=f)
36
37     print("""
38 !define MUI_ICON "%graphics%/dcpomatic2.ico"
39 !define MUI_UNICON "%graphics%/dcpomatic2.ico"
40 !define MUI_SPECIALBITMAP "%graphics%/dcpomatic.bmp"
41 !include "Sections.nsh"
42     """, file=f)
43
44     if bits == 64:
45         program_files = "$PROGRAMFILES64"
46     else:
47         program_files = "$PROGRAMFILES"
48
49     if debug:
50         print('InstallDir "%s\\DCP-o-matic 2 debug"' % program_files, file=f)
51     else:
52         print('InstallDir "%s\\DCP-o-matic 2"' % program_files, file=f)
53
54     print("""
55 !insertmacro MUI_PAGE_WELCOME
56 !insertmacro MUI_PAGE_LICENSE "../../../COPYING"
57 !insertmacro MUI_PAGE_DIRECTORY
58 !insertmacro MUI_PAGE_COMPONENTS
59
60 Section "Common files (required)" SEC_COMMON
61 SectionIn RO
62     """, file=f)
63
64     if bits == 64:
65         print("""
66 ; disable registry redirection (enable access to 64-bit portion of registry)
67 SetRegView 64
68         """, file=f)
69
70     print("""
71 SetOutPath "$INSTDIR\\bin"
72 WriteUninstaller "$INSTDIR\\Uninstall.exe"
73
74 File "%static_deps%/bin/libintl-8.dll"
75 File "%static_deps%/bin/libboost_chrono-mt.dll"
76 File "%static_deps%/bin/libboost_filesystem-mt.dll"
77 File "%static_deps%/bin/libboost_system-mt.dll"
78 File "%static_deps%/bin/libboost_thread-mt.dll"
79 File "%static_deps%/bin/libboost_date_time-mt.dll"
80 File "%static_deps%/bin/libboost_locale-mt.dll"
81 File "%static_deps%/bin/libboost_regex-mt.dll"
82 File "%static_deps%/bin/libeay32.dll"
83 File "%static_deps%/bin/libgcc_s_sjlj-1.dll"
84 File "%static_deps%/bin/libgio-2.0-0.dll"
85 File "%static_deps%/bin/libglib-2.0-0.dll"
86 File "%static_deps%/bin/libgobject-2.0-0.dll"
87 File "%static_deps%/bin/libiconv-2.dll"
88 File "%static_deps%/bin/libjpeg-8.dll"
89 File "%static_deps%/bin/libMagick++-6.Q16-3.dll"
90 File "%static_deps%/bin/libMagickCore-6.Q16-1.dll"
91 File "%static_deps%/bin/libMagickWand-6.Q16-1.dll"
92 File "%static_deps%/bin/libpng15-15.dll"
93 File "%static_deps%/bin/libsigc-2.0-0.dll"
94 File "%static_deps%/bin/libsndfile-1.dll"
95 File "%static_deps%/bin/libssh.dll"
96 File "%static_deps%/bin/libstdc++-6.dll"
97 File "%static_deps%/bin/zlib1.dll"
98 File "%static_deps%/bin/libjpeg-8.dll"
99 File "%static_deps%/bin/wxbase30u_gcc_custom.dll"
100 File "%static_deps%/bin/wxmsw30u_core_gcc_custom.dll"
101 File "%static_deps%/bin/wxmsw30u_adv_gcc_custom.dll"
102 File "%static_deps%/bin/wxmsw30u_richtext_gcc_custom.dll"
103 File "%static_deps%/bin/wxmsw30u_html_gcc_custom.dll"
104 File "%static_deps%/bin/wxbase30u_xml_gcc_custom.dll"
105 File "%static_deps%/bin/libcairo-2.dll"
106 File "%static_deps%/bin/libfreetype-6.dll"
107 File "%static_deps%/bin/libgthread-2.0-0.dll"
108 File "%static_deps%/bin/libpango-1.0-0.dll"
109 File "%static_deps%/bin/libgmodule-2.0-0.dll"
110 File "%static_deps%/bin/libpangocairo-1.0-0.dll"
111 File "%static_deps%/bin/libpangowin32-1.0-0.dll"
112 File "%static_deps%/bin/libtiff-5.dll"
113 File "%static_deps%/bin/libglibmm-2.4-1.dll"
114 File "%static_deps%/bin/libxml++-2.6-2.dll"
115 File "%static_deps%/bin/libxml2-2.dll"
116 File "%static_deps%/bin/libpixman-1-0.dll"
117 File "%static_deps%/bin/libfontconfig-1.dll"
118 File "%static_deps%/bin/libexpat-1.dll"
119 File "%static_deps%/bin/libbz2.dll"
120 File "%static_deps%/bin/libxmlsec1.dll"
121 File "%static_deps%/bin/libxmlsec1-openssl.dll"
122 File "%static_deps%/bin/libexslt-0.dll"
123 File "%static_deps%/bin/libxslt-1.dll"
124 File "%static_deps%/bin/libffi-6.dll"
125 File "%static_deps%/bin/openssl.exe"
126 File "%static_deps%/bin/libcurl-4.dll"
127 File "%static_deps%/bin/ssleay32.dll"
128 File "%static_deps%/bin/libzip-2.dll"
129 File "%static_deps%/bin/libcairomm-1.0-1.dll"
130 File "%static_deps%/bin/libpangomm-1.4-1.dll"
131 File "%static_deps%/bin/pango-querymodules.exe"
132 File "%static_deps%/bin/libsamplerate-0.dll"
133 File "%static_deps%/bin/libnettle-6-2.dll"
134 File "%static_deps%/lib/icuuc52.dll"
135 File "%static_deps%/lib/icudt52.dll"
136 File "%static_deps%/lib/icuin52.dll"
137
138 File "%cdist_deps%/bin/asdcp-cth.dll"
139 File "%cdist_deps%/bin/kumu-cth.dll"
140 File "%cdist_deps%/bin/avcodec-57.dll"
141 File "%cdist_deps%/bin/avfilter-6.dll"
142 File "%cdist_deps%/bin/avformat-57.dll"
143 File "%cdist_deps%/bin/avutil-55.dll"
144 File "%cdist_deps%/bin/avdevice-57.dll"
145 File "%cdist_deps%/bin/postproc-54.dll"
146 File "%cdist_deps%/bin/swresample-2.dll"
147 File "%cdist_deps%/bin/dcp-1.0.dll"
148 File "%cdist_deps%/bin/swscale-4.dll"
149 File "%cdist_deps%/bin/cxml-0.dll"
150 File "%cdist_deps%/bin/sub-1.0.dll"
151 File "%cdist_deps%/bin/ffprobe.exe"
152     """, file=f)
153
154     if windows_version == 'xp':
155         print('File "%cdist_deps%/bin/libopenjpeg-1.dll"', file=f)
156     else:
157         print('File "%cdist_deps%/bin/libopenjp2.dll"', file=f)
158
159     if debug:
160         print('File "%resources%/gdb_script"', file=f)
161         print('File "%resources%/dcpomatic2_debug.bat"', file=f)
162         print('File "%resources%/dcpomatic2_batch_debug.bat"', file=f)
163         print('File "%resources%/dcpomatic2_kdm_debug.bat"', file=f)
164         print('File "%mingw%/gdb.exe"', file=f)
165         print('File "%mingw%/addr2line.exe"', file=f)
166     else:
167         print('File "%binaries%/src/wx/dcpomatic2-wx.dll"', file=f)
168         print('File "%binaries%/src/lib/dcpomatic2.dll"', file=f)
169
170     print("""
171 SetOutPath "$INSTDIR\\lib\\pango\\1.8.0\\modules"
172 File "%static_deps%/lib/pango/1.8.0/modules/pango-arabic-lang.dll"
173 File "%static_deps%/lib/pango/1.8.0/modules/pango-basic-win32.dll"
174 File "%static_deps%/lib/pango/1.8.0/modules/pango-indic-lang.dll"
175
176 SetOutPath "$INSTDIR\\bin"
177 # I don't know why, but sometimes it seems that
178 # delegates.xml must be in with the binaries, and
179 # sometimes in the $PROFILE.  Meh.
180 File "%static_deps%/etc/ImageMagick-6/delegates.xml"
181 SetOutPath "$PROFILE\\.magick"
182 File "%static_deps%/etc/ImageMagick-6/delegates.xml"
183
184 SetOutPath "$INSTDIR\\locale\\fr\\LC_MESSAGES"
185 File "%binaries%/src/lib/mo/fr_FR/libdcpomatic2.mo"
186 File "%binaries%/src/wx/mo/fr_FR/libdcpomatic2-wx.mo"
187 File "%binaries%/src/tools/mo/fr_FR/dcpomatic2.mo"
188 File "%static_deps%/share/locale/fr/LC_MESSAGES/wxstd.mo"
189 SetOutPath "$INSTDIR\\locale\\it\\LC_MESSAGES"
190 File "%binaries%/src/lib/mo/it_IT/libdcpomatic2.mo"
191 File "%binaries%/src/wx/mo/it_IT/libdcpomatic2-wx.mo"
192 File "%binaries%/src/tools/mo/it_IT/dcpomatic2.mo"
193 File "%static_deps%/share/locale/it/LC_MESSAGES/wxstd.mo"
194 SetOutPath "$INSTDIR\\locale\\es\\LC_MESSAGES"
195 File "%binaries%/src/lib/mo/es_ES/libdcpomatic2.mo"
196 File "%binaries%/src/wx/mo/es_ES/libdcpomatic2-wx.mo"
197 File "%binaries%/src/tools/mo/es_ES/dcpomatic2.mo"
198 File "%static_deps%/share/locale/es/LC_MESSAGES/wxstd.mo"
199 SetOutPath "$INSTDIR\\locale\\sv\\LC_MESSAGES"
200 File "%binaries%/src/lib/mo/sv_SE/libdcpomatic2.mo"
201 File "%binaries%/src/wx/mo/sv_SE/libdcpomatic2-wx.mo"
202 File "%binaries%/src/tools/mo/sv_SE/dcpomatic2.mo"
203 File "%static_deps%/share/locale/sv/LC_MESSAGES/wxstd.mo"
204 SetOutPath "$INSTDIR\\locale\\de\\LC_MESSAGES"
205 File "%binaries%/src/lib/mo/de_DE/libdcpomatic2.mo"
206 File "%binaries%/src/wx/mo/de_DE/libdcpomatic2-wx.mo"
207 File "%binaries%/src/tools/mo/de_DE/dcpomatic2.mo"
208 File "%static_deps%/share/locale/de/LC_MESSAGES/wxstd.mo"
209 SetOutPath "$INSTDIR\\locale\\nl\\LC_MESSAGES"
210 File "%binaries%/src/lib/mo/nl_NL/libdcpomatic2.mo"
211 File "%binaries%/src/wx/mo/nl_NL/libdcpomatic2-wx.mo"
212 File "%binaries%/src/tools/mo/nl_NL/dcpomatic2.mo"
213 File "%static_deps%/share/locale/nl/LC_MESSAGES/wxstd.mo"
214 SetOutPath "$INSTDIR\\locale\\ru\\LC_MESSAGES"
215 File "%binaries%/src/lib/mo/ru_RU/libdcpomatic2.mo"
216 File "%binaries%/src/wx/mo/ru_RU/libdcpomatic2-wx.mo"
217 File "%binaries%/src/tools/mo/ru_RU/dcpomatic2.mo"
218 File "%static_deps%/share/locale/ru/LC_MESSAGES/wxstd.mo"
219 SetOutPath "$INSTDIR\\locale\\pl\\LC_MESSAGES"
220 File "%binaries%/src/lib/mo/pl_PL/libdcpomatic2.mo"
221 File "%binaries%/src/wx/mo/pl_PL/libdcpomatic2-wx.mo"
222 File "%binaries%/src/tools/mo/pl_PL/dcpomatic2.mo"
223 File "%static_deps%/share/locale/pl/LC_MESSAGES/wxstd.mo"
224 SetOutPath "$INSTDIR\\locale\\da\\LC_MESSAGES"
225 File "%binaries%/src/lib/mo/da_DK/libdcpomatic2.mo"
226 File "%binaries%/src/wx/mo/da_DK/libdcpomatic2-wx.mo"
227 File "%binaries%/src/tools/mo/da_DK/dcpomatic2.mo"
228 File "%static_deps%/share/locale/da/LC_MESSAGES/wxstd.mo"
229 SetOutPath "$INSTDIR\\locale\\pt_PT\\LC_MESSAGES"
230 File "%binaries%/src/lib/mo/pt_PT/libdcpomatic2.mo"
231 File "%binaries%/src/wx/mo/pt_PT/libdcpomatic2-wx.mo"
232 File "%binaries%/src/tools/mo/pt_PT/dcpomatic2.mo"
233 SetOutPath "$INSTDIR\\locale\\pt_BR\\LC_MESSAGES"
234 File "%binaries%/src/lib/mo/pt_BR/libdcpomatic2.mo"
235 File "%binaries%/src/wx/mo/pt_BR/libdcpomatic2-wx.mo"
236 File "%binaries%/src/tools/mo/pt_BR/dcpomatic2.mo"
237 SetOutPath "$INSTDIR\\locale\\sk\\LC_MESSAGES"
238 File "%binaries%/src/lib/mo/sk_SK/libdcpomatic2.mo"
239 File "%binaries%/src/wx/mo/sk_SK/libdcpomatic2-wx.mo"
240 File "%binaries%/src/tools/mo/sk_SK/dcpomatic2.mo"
241 SetOutPath "$INSTDIR\\locale\\cs\\LC_MESSAGES"
242 File "%binaries%/src/lib/mo/cs_CZ/libdcpomatic2.mo"
243 File "%binaries%/src/wx/mo/cs_CZ/libdcpomatic2-wx.mo"
244 File "%binaries%/src/tools/mo/cs_CZ/dcpomatic2.mo"
245 File "%static_deps%/share/locale/cs/LC_MESSAGES/wxstd.mo"
246 SetOutPath "$INSTDIR\\locale\\uk\\LC_MESSAGES"
247 File "%binaries%/src/lib/mo/uk_UA/libdcpomatic2.mo"
248 File "%binaries%/src/wx/mo/uk_UA/libdcpomatic2-wx.mo"
249 File "%binaries%/src/tools/mo/uk_UA/dcpomatic2.mo"
250 SetOutPath "$INSTDIR\\locale\\zh_cn\\LC_MESSAGES"
251 File "%binaries%/src/lib/mo/zh_CN/libdcpomatic2.mo"
252 File "%binaries%/src/wx/mo/zh_CN/libdcpomatic2-wx.mo"
253 File "%binaries%/src/tools/mo/zh_CN/dcpomatic2.mo"
254
255 SetOutPath "$INSTDIR"
256 File "%resources%/../../fonts/LiberationSans-Regular.ttf"
257 File "%resources%/../../fonts/LiberationSans-Italic.ttf"
258 File "%resources%/../../fonts/LiberationSans-Bold.ttf"
259 File "%graphics%/splash.png"
260
261 CreateDirectory "$INSTDIR\etc\pango"
262 ReadEnvStr $0 COMSPEC
263 SetOutPath "$INSTDIR"
264 nsExec::ExecToLog '$0 /C bin\pango-querymodules.exe > etc\pango\pango.modules'
265
266 SectionEnd
267     """, file=f)
268
269     if debug:
270         print('Section "DCP-o-matic 2 debug" SEC_MASTER', file=f)
271     else:
272         print('Section "DCP-o-matic 2" SEC_MASTER', file=f)
273
274     print('SetOutPath "$INSTDIR\\bin"', file=f)
275
276     if debug:
277         print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2 debug"', file=f)
278     else:
279         print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"', file=f)
280
281     print("""
282 File "%binaries%/src/tools/dcpomatic2.exe"
283 File "%binaries%/src/tools/dcpomatic2_batch.exe"
284 File "%binaries%/src/tools/dcpomatic2_cli.exe"
285 File "%binaries%/src/tools/dcpomatic2_create.exe"
286 File "%binaries%/src/tools/dcpomatic2_kdm.exe"
287     """, file=f)
288
289     if debug:
290         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat"', file=f)
291         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 batch converter debug.lnk" "$INSTDIR\\bin\\dcpomatic2_batch_debug.bat" ""', file=f)
292         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 KDM creator debug.lnk" "$INSTDIR\\bin\\dcpomatic2_kdm_debug.bat" ""', file=f)
293         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\Uninstall DCP-o-matic 2 debug.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
294         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "DisplayName" "DCP-o-matic 2 debug (remove only)"', file=f)
295         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
296     else:
297         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe"', file=f)
298         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 batch converter.lnk" "$INSTDIR\\bin\\dcpomatic2_batch.exe"', file=f)
299         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 KDM creator.lnk" "$INSTDIR\\bin\\dcpomatic2_kdm.exe"', file=f)
300         print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
301         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "DisplayName" "DCP-o-matic 2 (remove only)"', file=f)
302         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
303
304     print("SectionEnd", file=f)
305
306     if debug:
307         print('Section "DCP-o-matic 2 debug desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
308         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat" ""', file=f)
309         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 batch converter debug.lnk" "$INSTDIR\\bin\\dcpomatic2_batch_debug.bat" ""', file=f)
310         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 KDM creator debug.lnk" "$INSTDIR\\bin\\dcpomatic2_kdm_debug.bat" ""', file=f)
311     else:
312         print('Section "DCP-o-matic 2 desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
313         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe" ""', file=f)
314         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 batch converter.lnk" "$INSTDIR\\bin\\dcpomatic2_batch.exe"', file=f)
315         print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 KDM creator.lnk" "$INSTDIR\\bin\\dcpomatic2_kdm.exe"', file=f)
316
317     print("SectionEnd", file=f)
318
319     if not debug:
320         print("""
321 Section "Encode server" SEC_SERVER
322 SetOutPath "$INSTDIR\\bin"
323 CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"
324 File "%binaries%/src/tools/dcpomatic2_server_cli.exe"
325 File "%binaries%/src/tools/dcpomatic2_server.exe"
326 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 encode server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" "" "$INSTDIR\\bin\\dcpomatic2_server.exe" 0
327 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0
328 SectionEnd
329     """, file=f)
330
331         print("""
332 Section "Encode server desktop shortcuts" SEC_SERVER_DESKTOP
333 CreateShortCut "$DESKTOP\\DCP-o-matic 2 encode server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" ""
334 SectionEnd
335     """, file=f)
336
337     if debug:
338         print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2 debug"', file=f)
339         print('LangString DESC_SEC_MASTER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 debug desktop shortcuts"', file=f)
340     else:
341         print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2"', file=f)
342         print('LangString DESC_SEC_MASTER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 desktop shortcuts"', file=f)
343         print('LangString DESC_SEC_SERVER ${LANG_ENGLISH} "DCP-o-matic 2 encode server"', file=f)
344         print('LangString DESC_SEC_SERVER_DESKTOP ${LANG_ENGLISH} "DCP-o-matic 2 encode server desktop shortcuts"', file=f)
345
346     print("""
347 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
348   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER} $(DESC_SEC_MASTER)
349   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER_DESKTOP} $(DESC_SEC_MASTER_DESKTOP)
350   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER)
351   !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER_DESKTOP} $(DESC_SEC_SERVER_DESKTOP)
352 !insertmacro MUI_FUNCTION_DESCRIPTION_END
353
354 !insertmacro MUI_PAGE_INSTFILES
355 !insertmacro MUI_PAGE_FINISH
356
357 !insertmacro MUI_UNPAGE_WELCOME
358 !insertmacro MUI_UNPAGE_CONFIRM
359 !insertmacro MUI_UNPAGE_INSTFILES
360 !insertmacro MUI_UNPAGE_FINISH
361 !insertmacro MUI_LANGUAGE "English"
362     """, file=f)
363
364     if debug:
365         print("""
366 Section "Uninstall"
367 RMDir /r "$INSTDIR\\*.*"
368 RMDir "$INSTDIR"
369 Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"
370 Delete "$DESKTOP\\DCP-o-matic 2 batch converter debug.lnk"
371 Delete "$DESKTOP\\DCP-o-matic 2 KDM creator debug.lnk"
372 Delete "$SMPROGRAMS\\DCP-o-matic 2 debug\\*.*"
373 RmDir  "$SMPROGRAMS\\DCP-o-matic 2 debug"
374 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2 debug"
375 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug"
376  SectionEnd
377         """, file=f)
378     else:
379         print("""
380 Section "Uninstall"
381 RMDir /r "$INSTDIR\\*.*"
382 RMDir "$INSTDIR"
383 Delete "$DESKTOP\\DCP-o-matic 2.lnk"
384 Delete "$DESKTOP\\DCP-o-matic 2 batch converter.lnk"
385 Delete "$DESKTOP\\DCP-o-matic 2 encode server.lnk"
386 Delete "$DESKTOP\\DCP-o-matic 2 KDM creator.lnk"
387 Delete "$SMPROGRAMS\\DCP-o-matic 2\\*.*"
388 RmDir  "$SMPROGRAMS\\DCP-o-matic 2"
389 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2"
390 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2"
391  SectionEnd
392     """, file=f)
393
394
395 def build(bld):
396     write_installer(32, None, bld.env.VERSION, bld.env.DEBUG)
397     write_installer(64, None, bld.env.VERSION, bld.env.DEBUG)
398     write_installer(32, 'xp', bld.env.VERSION, bld.env.DEBUG)
399     write_installer(64, 'xp', bld.env.VERSION, bld.env.DEBUG)