From 02b0dd19a9a6a14e8b1cde3da34e470274ef9d1a Mon Sep 17 00:00:00 2001 From: Matthew Wener <125427297+ConstrictM@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:08:17 -0400 Subject: [PATCH] Support WIX Version 5 Virtual Symbol "WixUISupportPerUser" needs to be overridden in WIX V5 https://wixtoolset.org/docs/fivefour/ --- bypy/windows/wix.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bypy/windows/wix.py b/bypy/windows/wix.py index 6eb2f88018..707641db25 100644 --- a/bypy/windows/wix.py +++ b/bypy/windows/wix.py @@ -37,6 +37,12 @@ def create_installer(env, compression_level='9'): with open(j(d(__file__), 'wix-template.xml'), 'rb') as f: template = f.read().decode('utf-8') + cmd = [WIX, '--version'] + WIXVERSION = run(*cmd, get_output=True).decode('utf-8').split('.')[0] + if int(WIXVERSION) >= 5: + # Virtual Symbol "WixUISupportPerUser" needs to be overridden in WIX V5 https://wixtoolset.org/docs/fivefour/ + template = template.replace('WixUISupportPerUser', 'override WixUISupportPerUser') + components, smap = get_components_from_files(env) wxs = template.format( app=calibre_constants['appname'],