1 from __future__ import print_function
4 def write_installer(bits, version, debug):
6 os.makedirs('build/platform/windows')
10 f = open('build/platform/windows/installer.%d.nsi' % bits, 'w')
11 print('!include "MUI2.nsh"', file=f)
13 print('!include "x64.nsh"', file=f)
16 print('Name "DCP-o-matic Debug"', file=f)
18 print('Name "DCP-o-matic"', file=f)
20 print('RequestExecutionLevel admin', file=f)
23 print('outFile "DCP-o-matic Debug %s %d-bit Installer.exe"' % (version, bits), file=f)
25 print('outFile "DCP-o-matic %s %d-bit Installer.exe"' % (version, bits), file=f)
28 !define MUI_ICON "%resources%/dcpomatic.ico"
29 !define MUI_UNICON "%resources%/dcpomatic.ico"
30 !define MUI_SPECIALBITMAP "%resources%/dcpomatic.bmp"
31 !include "Sections.nsh"
35 print('InstallDir "$PROGRAMFILES\\DCP-o-matic 2 Debug"', file=f)
37 print('InstallDir "$PROGRAMFILES\\DCP-o-matic 2"', file=f)
40 !insertmacro MUI_PAGE_WELCOME
41 !insertmacro MUI_PAGE_LICENSE "../../../COPYING"
42 !insertmacro MUI_PAGE_DIRECTORY
43 !insertmacro MUI_PAGE_COMPONENTS
45 Section "Common files (required)" SEC_COMMON
52 DetailPrint "Installer running on 64-bit host"
53 ; disable registry redirection (enable access to 64-bit portion of registry)
56 StrCpy $INSTDIR "$PROGRAMFILES64\DCP-o-matic 2"
61 SetOutPath "$INSTDIR\\bin"
62 WriteUninstaller "$INSTDIR\\Uninstall.exe"
64 File "%static_deps%/bin/libintl-8.dll"
65 File "%static_deps%/bin/libboost_chrono-mt.dll"
66 File "%static_deps%/bin/libboost_filesystem-mt.dll"
67 File "%static_deps%/bin/libboost_system-mt.dll"
68 File "%static_deps%/bin/libboost_thread_win32-mt.dll"
69 File "%static_deps%/bin/libboost_date_time-mt.dll"
70 File "%static_deps%/bin/libboost_locale-mt.dll"
71 File "%static_deps%/bin/libboost_regex-mt.dll"
72 File "%static_deps%/bin/libeay32.dll"
73 File "%static_deps%/bin/libgcc_s_sjlj-1.dll"
74 File "%static_deps%/bin/libgio-2.0-0.dll"
75 File "%static_deps%/bin/libglib-2.0-0.dll"
76 File "%static_deps%/bin/libgobject-2.0-0.dll"
77 File "%static_deps%/bin/libiconv-2.dll"
78 File "%static_deps%/bin/libjpeg-8.dll"
79 File "%static_deps%/bin/libMagick++-6.Q16-3.dll"
80 File "%static_deps%/bin/libMagickCore-6.Q16-1.dll"
81 File "%static_deps%/bin/libMagickWand-6.Q16-1.dll"
82 File "%static_deps%/bin/libpng15-15.dll"
83 File "%static_deps%/bin/libsigc-2.0-0.dll"
84 File "%static_deps%/bin/libsndfile-1.dll"
85 File "%static_deps%/bin/libssh.dll"
86 File "%static_deps%/bin/libstdc++-6.dll"
87 File "%static_deps%/bin/zlib1.dll"
88 File "%static_deps%/bin/libjpeg-8.dll"
89 File "%static_deps%/bin/wxbase30u_gcc_custom.dll"
90 File "%static_deps%/bin/wxmsw30u_core_gcc_custom.dll"
91 File "%static_deps%/bin/wxmsw30u_adv_gcc_custom.dll"
92 File "%static_deps%/bin/wxmsw30u_richtext_gcc_custom.dll"
93 File "%static_deps%/bin/wxmsw30u_html_gcc_custom.dll"
94 File "%static_deps%/bin/wxbase30u_xml_gcc_custom.dll"
95 File "%static_deps%/bin/libcairo-2.dll"
96 File "%static_deps%/bin/libfreetype-6.dll"
97 File "%static_deps%/bin/libgthread-2.0-0.dll"
98 File "%static_deps%/bin/libpango-1.0-0.dll"
99 File "%static_deps%/bin/libgmodule-2.0-0.dll"
100 File "%static_deps%/bin/libpangocairo-1.0-0.dll"
101 File "%static_deps%/bin/libpangowin32-1.0-0.dll"
102 File "%static_deps%/bin/libtiff-5.dll"
103 File "%static_deps%/bin/libglibmm-2.4-1.dll"
104 File "%static_deps%/bin/libxml++-2.6-2.dll"
105 File "%static_deps%/bin/libxml2-2.dll"
106 File "%static_deps%/bin/libpixman-1-0.dll"
107 File "%static_deps%/bin/libfontconfig-1.dll"
108 File "%static_deps%/bin/libexpat-1.dll"
109 File "%static_deps%/bin/libbz2.dll"
110 File "%static_deps%/bin/libxmlsec1.dll"
111 File "%static_deps%/bin/libxmlsec1-openssl.dll"
112 File "%static_deps%/bin/libexslt-0.dll"
113 File "%static_deps%/bin/libxslt-1.dll"
114 File "%static_deps%/bin/libffi-6.dll"
115 File "%static_deps%/bin/openssl.exe"
116 File "%static_deps%/bin/libcurl-4.dll"
117 File "%static_deps%/bin/ssleay32.dll"
118 File "%static_deps%/bin/libzip-2.dll"
119 File "%static_deps%/bin/libcairomm-1.0-1.dll"
120 File "%static_deps%/bin/libpangomm-1.4-1.dll"
121 File "%static_deps%/bin/pango-querymodules.exe"
122 File "%static_deps%/bin/libsamplerate-0.dll"
124 File "%cdist_deps%/bin/asdcp-libdcp-1.0.dll"
125 File "%cdist_deps%/bin/kumu-libdcp-1.0.dll"
126 File "%cdist_deps%/bin/avcodec-56.dll"
127 File "%cdist_deps%/bin/avfilter-5.dll"
128 File "%cdist_deps%/bin/avformat-56.dll"
129 File "%cdist_deps%/bin/avutil-54.dll"
130 File "%cdist_deps%/bin/avdevice-56.dll"
131 File "%cdist_deps%/bin/postproc-53.dll"
132 File "%cdist_deps%/bin/dcp-1.0.dll"
133 File "%cdist_deps%/bin/libopenjpeg-1.dll"
134 File "%cdist_deps%/bin/swresample-1.dll"
135 File "%cdist_deps%/bin/swscale-3.dll"
136 File "%cdist_deps%/bin/cxml-0.dll"
137 File "%cdist_deps%/bin/sub-1.0.dll"
138 File "%cdist_deps%/bin/asdcp-libsub-1.0.dll"
139 File "%cdist_deps%/bin/kumu-libsub-1.0.dll"
140 File "%cdist_deps%/bin/ffprobe.exe"
144 print('File "%resources%/gdb_script"', file=f)
145 print('File "%resources%/debug.bat"', file=f)
146 print('File "%mingw%/gdb.exe"', file=f)
147 print('File "%mingw%/addr2line.exe"', file=f)
149 print('File "%binaries%/src/wx/dcpomatic2-wx.dll"', file=f)
150 print('File "%binaries%/src/lib/dcpomatic2.dll"', file=f)
153 SetOutPath "$INSTDIR\\lib\\pango\\1.8.0\\modules"
154 File "%static_deps%/lib/pango/1.8.0/modules/pango-arabic-lang.dll"
155 File "%static_deps%/lib/pango/1.8.0/modules/pango-basic-win32.dll"
156 File "%static_deps%/lib/pango/1.8.0/modules/pango-indic-lang.dll"
158 SetOutPath "$INSTDIR\\bin"
159 # I don't know why, but sometimes it seems that
160 # delegates.xml must be in with the binaries, and
161 # sometimes in the $PROFILE. Meh.
162 File "%static_deps%/etc/ImageMagick-6/delegates.xml"
163 SetOutPath "$PROFILE\\.magick"
164 File "%static_deps%/etc/ImageMagick-6/delegates.xml"
166 SetOutPath "$INSTDIR\\locale\\fr\\LC_MESSAGES"
167 File "%binaries%/src/lib/mo/fr_FR/libdcpomatic2.mo"
168 File "%binaries%/src/wx/mo/fr_FR/libdcpomatic2-wx.mo"
169 File "%binaries%/src/tools/mo/fr_FR/dcpomatic2.mo"
170 File "%static_deps%/share/locale/fr/LC_MESSAGES/wxstd.mo"
171 SetOutPath "$INSTDIR\\locale\\it\\LC_MESSAGES"
172 File "%binaries%/src/lib/mo/it_IT/libdcpomatic2.mo"
173 File "%binaries%/src/wx/mo/it_IT/libdcpomatic2-wx.mo"
174 File "%binaries%/src/tools/mo/it_IT/dcpomatic2.mo"
175 File "%static_deps%/share/locale/it/LC_MESSAGES/wxstd.mo"
176 SetOutPath "$INSTDIR\\locale\\es\\LC_MESSAGES"
177 File "%binaries%/src/lib/mo/es_ES/libdcpomatic2.mo"
178 File "%binaries%/src/wx/mo/es_ES/libdcpomatic2-wx.mo"
179 File "%binaries%/src/tools/mo/es_ES/dcpomatic2.mo"
180 File "%static_deps%/share/locale/es/LC_MESSAGES/wxstd.mo"
181 SetOutPath "$INSTDIR\\locale\\sv\\LC_MESSAGES"
182 File "%binaries%/src/lib/mo/sv_SE/libdcpomatic2.mo"
183 File "%binaries%/src/wx/mo/sv_SE/libdcpomatic2-wx.mo"
184 File "%binaries%/src/tools/mo/sv_SE/dcpomatic2.mo"
185 File "%static_deps%/share/locale/sv/LC_MESSAGES/wxstd.mo"
186 SetOutPath "$INSTDIR\\locale\\de\\LC_MESSAGES"
187 File "%binaries%/src/lib/mo/de_DE/libdcpomatic2.mo"
188 File "%binaries%/src/wx/mo/de_DE/libdcpomatic2-wx.mo"
189 File "%binaries%/src/tools/mo/de_DE/dcpomatic2.mo"
190 File "%static_deps%/share/locale/de/LC_MESSAGES/wxstd.mo"
191 SetOutPath "$INSTDIR\\locale\\nl\\LC_MESSAGES"
192 File "%binaries%/src/lib/mo/nl_NL/libdcpomatic2.mo"
193 File "%binaries%/src/wx/mo/nl_NL/libdcpomatic2-wx.mo"
194 File "%binaries%/src/tools/mo/nl_NL/dcpomatic2.mo"
195 File "%static_deps%/share/locale/nl/LC_MESSAGES/wxstd.mo"
196 SetOutPath "$INSTDIR\\locale\\ru\\LC_MESSAGES"
197 File "%binaries%/src/lib/mo/ru_RU/libdcpomatic2.mo"
198 File "%binaries%/src/wx/mo/ru_RU/libdcpomatic2-wx.mo"
199 File "%binaries%/src/tools/mo/ru_RU/dcpomatic2.mo"
200 File "%static_deps%/share/locale/ru/LC_MESSAGES/wxstd.mo"
201 SetOutPath "$INSTDIR\\locale\\pl\\LC_MESSAGES"
202 File "%binaries%/src/lib/mo/pl_PL/libdcpomatic2.mo"
203 File "%binaries%/src/wx/mo/pl_PL/libdcpomatic2-wx.mo"
204 File "%binaries%/src/tools/mo/pl_PL/dcpomatic2.mo"
205 File "%static_deps%/share/locale/pl/LC_MESSAGES/wxstd.mo"
206 SetOutPath "$INSTDIR\\locale\\da\\LC_MESSAGES"
207 File "%binaries%/src/lib/mo/da_DK/libdcpomatic2.mo"
208 File "%binaries%/src/wx/mo/da_DK/libdcpomatic2-wx.mo"
209 File "%binaries%/src/tools/mo/da_DK/dcpomatic2.mo"
210 File "%static_deps%/share/locale/da/LC_MESSAGES/wxstd.mo"
212 SetOutPath "$INSTDIR"
213 File "%resources%/../../LiberationSans-Regular.ttf"
214 File "%graphics%/splash.png"
216 CreateDirectory "$INSTDIR\etc\pango"
217 ReadEnvStr $0 COMSPEC
218 SetOutPath "$INSTDIR"
219 nsExec::ExecToLog '$0 /C bin\pango-querymodules.exe > etc\pango\pango.modules'
225 print('Section "DCP-o-matic 2 Debug" SEC_MASTER', file=f)
227 print('Section "DCP-o-matic 2" SEC_MASTER', file=f)
229 print('SetOutPath "$INSTDIR\\bin"', file=f)
232 print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2 Debug"', file=f)
234 print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"', file=f)
237 File "%binaries%/src/tools/dcpomatic2.exe"
238 File "%binaries%/src/tools/dcpomatic2_batch.exe"
239 File "%binaries%/src/tools/dcpomatic2_cli.exe"
240 File "%binaries%/src/tools/dcpomatic2_create.exe"
244 print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 Debug.lnk" "$INSTDIR\\bin\\debug.bat" ""', file=f)
245 print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 Debug\\DCP-o-matic 2 Debug.lnk" "$INSTDIR\\bin\\debug.bat"', file=f)
246 print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2 Debug.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
247 print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 Debug" "DisplayName" "DCP-o-matic 2 Debug (remove only)"', file=f)
248 print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 Debug" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
250 print('CreateShortCut "$DESKTOP\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe" ""', file=f)
251 print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe"', file=f)
252 print('CreateShortCut "$DESKTOP\\DCP-o-matic 2 batch converter.lnk" "$INSTDIR\\bin\\dcpomatic2_batch.exe"', file=f)
253 print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 batch converter.lnk" "$INSTDIR\\bin\\dcpomatic2.exe"', file=f)
254 print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
255 print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "DisplayName" "DCP-o-matic 2 (remove only)"', file=f)
256 print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
264 Section "Encode server" SEC_SERVER
265 SetOutPath "$INSTDIR\\bin"
266 CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"
267 File "%binaries%/src/tools/dcpomatic2_server_cli.exe"
268 File "%binaries%/src/tools/dcpomatic2_server.exe"
269 CreateShortCut "$DESKTOP\\DCP-o-matic 2 encode server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" ""
270 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 encode server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" "" "$INSTDIR\\bin\\dcpomatic2_server.exe" 0
271 CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0
276 print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2 Debug"', file=f)
278 print('LangString DESC_SEC_MASTER ${LANG_ENGLISH} "DCP-o-matic 2"', file=f)
279 print('LangString DESC_SEC_SERVER ${LANG_ENGLISH} "DCP-o-matic 2 encode server"', file=f)
282 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
283 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_MASTER} $(DESC_SEC_MASTER)
284 !insertmacro MUI_DESCRIPTION_TEXT ${SEC_SERVER} $(DESC_SEC_SERVER)
285 !insertmacro MUI_FUNCTION_DESCRIPTION_END
287 !insertmacro MUI_PAGE_INSTFILES
288 !insertmacro MUI_PAGE_FINISH
290 !insertmacro MUI_UNPAGE_WELCOME
291 !insertmacro MUI_UNPAGE_CONFIRM
292 !insertmacro MUI_UNPAGE_INSTFILES
293 !insertmacro MUI_UNPAGE_FINISH
294 !insertmacro MUI_LANGUAGE "English"
300 RMDir /r "$INSTDIR\\*.*"
302 Delete "$DESKTOP\\DCP-o-matic 2 Debug.lnk"
303 Delete "$SMPROGRAMS\\DCP-o-matic 2 Debug\\*.*"
304 RmDir "$SMPROGRAMS\\DCP-o-matic 2 Debug"
305 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2 Debug"
306 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 Debug"
312 RMDir /r "$INSTDIR\\*.*"
314 Delete "$DESKTOP\\DCP-o-matic 2.lnk"
315 Delete "$DESKTOP\\DCP-o-matic 2 batch converter.lnk"
316 Delete "$DESKTOP\\DCP-o-matic 2 encode server.lnk"
317 Delete "$SMPROGRAMS\\DCP-o-matic 2\\*.*"
318 RmDir "$SMPROGRAMS\\DCP-o-matic 2"
319 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\DCP-o-matic 2"
320 DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2"
326 write_installer(32, bld.env.VERSION, bld.env.DEBUG)
327 write_installer(64, bld.env.VERSION, bld.env.DEBUG)