From a196bfe1722dfd9f9ee368ffdabd03a148b30ba7 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 7 Dec 2021 16:48:11 +0000 Subject: [PATCH] WiX: Autogeneration of EDMarketConnector.wxs fully working * Changed config version to 5.3.0-beta2 to be sure during testing. * Fixed the case on ChangeLog.md in setup.py py2exe config. * Replaced all TABs with <4 spaces> in wix/template.wxs. * Now generating the correct Feature tree in the output file. NB: The 'RegistryEntries' isn't part of the file Components but still needs to be referenced inside . --- config.py | 2 +- setup.py | 26 ++++++- wix/template.wxs | 194 +++++++++++++++++++++++------------------------ 3 files changed, 123 insertions(+), 99 deletions(-) diff --git a/config.py b/config.py index 7df3e218..ff0b7fed 100644 --- a/config.py +++ b/config.py @@ -33,7 +33,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.3.0-beta1' +_static_appversion = '5.3.0-beta2' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2021 EDCD' diff --git a/setup.py b/setup.py index bfab647d..ba88ce7c 100755 --- a/setup.py +++ b/setup.py @@ -212,7 +212,7 @@ elif sys.platform == 'win32': 'WinSparkle.dll', 'WinSparkle.pdb', # For debugging - don't include in package 'EUROCAPS.TTF', - 'Changelog.md', + 'ChangeLog.md', 'commodity.csv', 'rare_commodity.csv', 'snd_good.wav', @@ -351,6 +351,30 @@ elif sys.platform == 'win32': program_files_folder.insert(0, directory_win32) # Append the Feature/ComponentRef listing to match + feature = template_tree.find('.//{*}Feature[@Id="Complete"][@Level="1"]') + if feature is None: + raise ValueError(f'{template_file}: Expected Feature element with Id="Complete" Level="1"') + + # This isn't part of the components + feature.append( + etree.Element( + 'ComponentRef', + attrib={ + 'Id': 'RegistryEntries' + }, + nsmap=directory_win32.nsmap + ) + ) + for c in directory_win32.findall('.//{*}Component'): + feature.append( + etree.Element( + 'ComponentRef', + attrib={ + 'Id': c.get('Id') + }, + nsmap=directory_win32.nsmap + ) + ) # Insert what we now have into the template and write it out template_tree.write( diff --git a/wix/template.wxs b/wix/template.wxs index 0d365919..7e4409a4 100644 --- a/wix/template.wxs +++ b/wix/template.wxs @@ -6,119 +6,119 @@ - + - - - + + + - - - + + + - + - + - - - - + + + + - - - - - - - - - WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION - - - - - WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION - - + + + + + + + + + WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION + + + + + WIX_UPGRADE_DETECTED AND ARPINSTALLLOCATION + + - - - - - - NOT Installed - - + + + + + + NOT Installed + + - - - - - - - NOT Installed AND LAUNCH ~= "yes" - - + + + + + + + NOT Installed AND LAUNCH ~= "yes" + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - + - - + + - +