From 6ed64c9d6b5e0202b27101e92c7fc04478d9bf0b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 7 Dec 2021 15:51:38 +0000 Subject: [PATCH] WiX: .gitignore components.wxs & add template.wxs Also renamed header.wxs to template.wxs in setup.py, as we're going to insert into the middle of its content, not use it as a simple concatenated header. --- .gitignore | 1 + setup.py | 8 +-- wix/template.wxs | 126 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 3 deletions(-) create mode 100644 wix/template.wxs diff --git a/.gitignore b/.gitignore index 49459783..9bea3d5a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ htmlcov/ .ignored .coverage EDMarketConnector.wxs +wix/components.wxs diff --git a/setup.py b/setup.py index a87773f6..afb4233c 100755 --- a/setup.py +++ b/setup.py @@ -286,11 +286,10 @@ if sys.platform == 'darwin': os.system(f'cd {dist_dir}; ditto -ck --keepParent --sequesterRsrc {appname}.app ../{package_filename}; cd ..') elif sys.platform == 'win32': - header_file = pathlib.Path('wix/header.wxs') + template_file = pathlib.Path('wix/template.wxs') components_file = pathlib.Path('wix/components.wxs') components_transformed_file = pathlib.Path(r'wix/components_transformed.wxs') - header_tree = etree.parse(header_file) # Use heat.exe to generate the Component for all files inside dist.win32 os.system(rf'"{WIXPATH}\heat.exe" dir {dist_dir}\ -ag -sfrag -srid -suid -out {components_file}') @@ -345,7 +344,10 @@ elif sys.platform == 'win32': ) # Append the Feature/ComponentRef listing to match - # Concatenate our header, this middle, and our footer. + + template_tree = etree.parse(template_file) + # Insert what we now have into the template and write it out + os.system(rf'"{WIXPATH}\candle.exe" -out {dist_dir}\ {appname}.wxs') if not exists(f'{dist_dir}/{appname}.wixobj'): diff --git a/wix/template.wxs b/wix/template.wxs new file mode 100644 index 00000000..0d365919 --- /dev/null +++ b/wix/template.wxs @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION + + + + + WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION + + + + + + + + + NOT Installed + + + + + + + + + + NOT Installed AND LAUNCH ~= "yes" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +