From 37f7e87206829169ca88bc9facde5c3c2f09874d Mon Sep 17 00:00:00 2001 From: Marcin Raba Date: Mon, 9 Sep 2024 16:17:54 +0200 Subject: [PATCH] SNOW-1055755: windows build debug - ...wix util schema --- .../win/snowflake_cli_template_v4.wxs | 81 +++++++++++++++++++ scripts/packaging/win/wxs_builder.py | 14 ++-- 2 files changed, 87 insertions(+), 8 deletions(-) create mode 100644 scripts/packaging/win/snowflake_cli_template_v4.wxs diff --git a/scripts/packaging/win/snowflake_cli_template_v4.wxs b/scripts/packaging/win/snowflake_cli_template_v4.wxs new file mode 100644 index 0000000000..7c49928656 --- /dev/null +++ b/scripts/packaging/win/snowflake_cli_template_v4.wxs @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/packaging/win/wxs_builder.py b/scripts/packaging/win/wxs_builder.py index 91fc7d05f2..be6d7a9733 100644 --- a/scripts/packaging/win/wxs_builder.py +++ b/scripts/packaging/win/wxs_builder.py @@ -7,14 +7,13 @@ DIST_DIR = PROJECT_ROOT_PATH.joinpath("dist") LIBS = DIST_DIR.joinpath("snow") -WXS_TEMPLATE_FILE = ( - Path(__file__).parent.absolute().joinpath("snowflake_cli_template.wxs") -) -WXS_FILE = Path(__file__).parent.absolute().joinpath("snowflake_cli.wxs") +WIN_RES_DIR = Path(__file__).parent.absolute() +WXS_TEMPLATE_FILE = WIN_RES_DIR.joinpath("snowflake_cli_template_v4.wxs") +WXS_OUTPUT_FILE = WXS_TEMPLATE_FILE.parent.joinpath("snowflake_cli.wxs") wxs = ElementTree.parse(WXS_TEMPLATE_FILE) root = wxs.getroot() -snow_files_xpath = ".//{http://schemas.microsoft.com/wix/2006/wi}Component" +snow_files_xpath = ".//{http://wixtoolset.org/schemas/v4/wxs}Component" snow_files = root.findall(snow_files_xpath) @@ -38,7 +37,6 @@ file.set("Id", str(relative_lib_path)) source_path = lib_path.relative_to(PROJECT_ROOT_PATH) file.set("Source", str(source_path)) - file.set("Name", "PATH") file.set("KeyPath", "yes") file.set("Checksum", "yes") @@ -46,7 +44,7 @@ component.set("Id", relative_file) guid_hash = str(uuid.uuid3(uuid.NAMESPACE_DNS, relative_file)).upper() component.set("Guid", guid_hash) - component.set("Win64", "yes") + component.set("Bitness", "always64") component.append(environment) component.append(file) @@ -55,5 +53,5 @@ ElementTree.indent(root, space=" ", level=0) -with WXS_FILE.expanduser().open("wb") as f: +with WXS_OUTPUT_FILE.expanduser().open("wb") as f: wxs.write(f, encoding="utf-8")