RedFlag/installer/windows/render-license.py
Fimeg 765ec4188f publish: carry the Windows product into the projection
The tree adds the installer, service and test paths admitted by this source commit. Nothing else changes about what may cross.

Source-Sha: 3e4a3aa4ce092e9e3f51bc78daf3ddc14d9638f8

Policy-Sha: 3e4a3aa4ce092e9e3f51bc78daf3ddc14d9638f8

Tree-Digest: 89d6fce3828a0e0de0c8eeb41ee6750f4462217e2a04b5190297134d7f4a50c3
2026-09-09 12:47:34 -04:00

17 lines
627 B
Python

#!/usr/bin/env python3
"""Put the repository's complete license into the MSI's native RTF control."""
import pathlib
import sys
def render(text):
# The repository license is ASCII. Refuse lossy conversion if that changes.
text.encode("ascii")
escaped = text.replace("\\", "\\\\").replace("{", "\\{").replace("}", "\\}")
return "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0 Segoe UI;}}\\f0\\fs18\n" + escaped.replace("\n", "\\par\n") + "}\n"
if __name__ == "__main__":
source, destination = map(pathlib.Path, sys.argv[1:])
destination.write_text(render(source.read_text(encoding="utf-8")), encoding="ascii")