return 'Verifier'
def tool_name(variant, debug, tool):
- name = f'DCP-o-matic 2 {tool}'
+ name = 'DCP-o-matic 2 %s' % tool
if debug:
name += ' debug'
return name
folder = start_menu_shortcut_folder(variant)
if debug:
folder += ' debug'
- print(f'CreateShortCut "$SMPROGRAMS\\{folder}\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
+ print('CreateShortCut "$SMPROGRAMS\\%s\\%s.lnk" "$INSTDIR\\%s"' % (folder, link, target), file=file)
def write_installer(bits, dcpomatic_version, debug, disk, variant):
if bits == 64:
print('!include "x64.nsh"', file=f)
- print(f'Name "{short_name_with_debug}"', file=f)
+ print('Name "%s"' % short_name_with_debug, file=f)
print('RequestExecutionLevel admin', file=f)
print('Unicode true', file=f)
- outfile = f'{short_name_with_debug} {dcpomatic_version} {bits}-bit Installer.exe'
+ outfile = '%s %s %d-bit Installer.exe' % (short_name_with_debug, dcpomatic_version, bits)
print('outFile "%s"' % outfile, file=f)
print("""
else:
program_files = "$PROGRAMFILES"
- print(f'InstallDir "%s\\{long_name_with_debug}"' % program_files, file=f)
+ print('InstallDir "%s\\%s"' % (program_files, long_name_with_debug), file=f)
print("""
!insertmacro MUI_PAGE_WELCOME
SectionEnd
""", file=f)
- print(f'Section "{long_name_with_debug}" SEC_MASTER', file=f)
+ print('Section "%s" SEC_MASTER' % long_name_with_debug, file=f)
print('SetOutPath "$INSTDIR\\bin"', file=f)
print("SetShellVarContext all", file=f)
- print(f'CreateDirectory "$SMPROGRAMS\\{long_name_with_debug}"', file=f)
+ print('CreateDirectory "$SMPROGRAMS\\%s"' % long_name_with_debug, file=f)
print('File "%binaries%/src/tools/dcpomatic2.exe"', file=f)
for s, l in tools:
""", file=f)
suffix = '_debug.bat' if debug else '.exe'
- start_menu_shortcut(f, long_name_with_debug, f'bin\\dcpomatic2{suffix}', variant, debug=True)
+ start_menu_shortcut(f, long_name_with_debug, 'bin\\dcpomatic2%s' % suffix, variant, debug=True)
for s, l in tools:
- start_menu_shortcut(f, tool_name(variant, debug, l), f'bin\\dcpomatic2_{s}{suffix}', variant, debug=True)
- start_menu_shortcut(f, f'Uninstall {long_name_with_debug}', 'Uninstall.exe', variant, debug=True)
- print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "DisplayName" "{long_name_with_debug} (remove only)"', file=f)
- print(f'WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{long_name_with_debug}" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
+ start_menu_shortcut(f, tool_name(variant, debug, l), 'bin\\dcpomatic2_%s%s' % (s, suffix), variant, debug=True)
+ start_menu_shortcut(f, 'Uninstall %s' % long_name_with_debug, 'Uninstall.exe', variant, debug=True)
+ print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s" "DisplayName" "%s (remove only)"' % (long_name_with_debug, long_name_with_debug), file=f)
+ print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s" "UninstallString" "$INSTDIR\\Uninstall.exe"' % long_name_with_debug, file=f)
print("SectionEnd", file=f)
- print(f'Section "{long_name_with_debug} desktop shortcuts" SEC_MASTER_DESKTOP', file=f)
- print(f'CreateShortCut "$DESKTOP\\{long_name_with_debug}.lnk" "$INSTDIR\\bin\\dcpomatic2{suffix}" ""', file=f)
+ print('Section "%s desktop shortcuts" SEC_MASTER_DESKTOP' % long_name_with_debug, file=f)
+ print('CreateShortCut "$DESKTOP\\%s.lnk" "$INSTDIR\\bin\\dcpomatic2%s" ""' % (long_name_with_debug, suffix), file=f)
for s, l in tools:
- print(f'CreateShortCut "$DESKTOP\\{tool_name(variant, debug, l)}.lnk" "$INSTDIR\\bin\\dcpomatic2_{s}{suffix}" ""', file=f)
+ print('CreateShortCut "$DESKTOP\\%s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s%s" ""' % (tool_name(variant, debug, l), s, suffix), file=f)
print("SectionEnd", file=f)
def make_rc(tool, icon, variant):
- filename = f'build/src/tools/{tool}.rc'
+ filename = 'build/src/tools/%s.rc' % tool
with open(filename, 'w') as rc:
if tool == 'dcpomatic_disk_writer':
print('#include "winuser.h"', file=rc)
</trustInfo>
</assembly>""", file=manifest)
else:
- print(f"""
-id ICON "../../graphics/windows/{icon}"
+ print("""
+id ICON "../../graphics/windows/%s"
#include "wx-3.1/wx/msw/wx.rc"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,2
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
-{{
+ {
BLOCK "StringFileInfo"
- {{
+ {
BLOCK "040904b0"
- {{
- VALUE "FileDescription", "{description(tool, variant)}\\0"
- }}
- }}
+ {
+ VALUE "FileDescription", "%s\\0"
+ }
+ }
BLOCK "VarFileInfo"
- {{
+ {
VALUE "Translation", 0x409, 1200
- }}
-}}
- """, file=rc)
+ }
+ }
+ """ % (icon, description(tool, variant)), file=rc)
return filename
def configure(conf):
obj.use = ['libdcpomatic2']
obj.source = '%s.cc' % t
if (bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32) and t == 'dcpomatic_disk_writer':
- obj.source += f' ../../{make_rc(t, None, bld.env.VARIANT)}'
+ obj.source += ' ../../%s' % (make_rc(t, None, bld.env.VARIANT))
# Prevent a console window opening when we start dcpomatic2_disk_writer
obj.env.append_value('LINKFLAGS', '-Wl,-subsystem,windows')
obj.target = t.replace('dcpomatic', 'dcpomatic2')
obj.use = ['libdcpomatic2', 'libdcpomatic2-wx']
obj.source = '%s.cc' % t
if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32:
- obj.source += f' ../../{make_rc(t, t.replace("dcpomatic", "dcpomatic2") + ".ico", bld.env.VARIANT)}'
+ obj.source += ' ../../%s' % make_rc(t, t.replace("dcpomatic", "dcpomatic2") + ".ico", bld.env.VARIANT)
obj.target = t.replace('dcpomatic', 'dcpomatic2')
i18n.po_to_mo(os.path.join('src', 'tools'), 'dcpomatic2', bld)