fix(windows): preserve registry separators during template expansion

This commit is contained in:
Palash Debnath
2026-09-07 11:55:42 +05:30
parent aed50121b4
commit 62b0e05c1d
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ def registry_key(name: str) -> ET.Element:
"RegistryValue",
{
"Root": "HKCU",
"Key": r"Software\{{@root.manufacturer}}\{{@root.product_name}}\Components",
"Key": r"Software\\{{@root.manufacturer}}\\{{@root.product_name}}\Components",
"Name": name,
"Type": "integer",
"Value": "1",
+7
View File
@@ -166,3 +166,10 @@ def test_external_binary_guid_is_explicit_and_stable_across_builds():
assert first_guid == second.split(marker)[1].split(" Win64=")[0]
assert '(eq bin.id "helper.exe")' in first_guid
assert 'Guid="*"' not in marker + first_guid
def test_registry_key_template_does_not_escape_handlebars_expressions():
key = _renderer().registry_key("MainBinary").attrib["Key"]
# A single backslash escapes the opening Handlebars delimiter. The canonical
# WiX template doubles it so the installed key uses resolved product names.
assert key == r"Software\\{{@root.manufacturer}}\\{{@root.product_name}}\Components"