Change: Write dangerzone version and upgradecode into Package and SummaryInformation elements directly

This commit is contained in:
JKarasti 2024-09-23 22:17:03 +03:00 committed by jkarasti
parent 4f97ed4177
commit d61f8667ae

View file

@ -84,7 +84,9 @@ def main():
with open(version_filename) as f: with open(version_filename) as f:
# Read the Dangerzone version from share/version.txt, and remove any potential # Read the Dangerzone version from share/version.txt, and remove any potential
# -rc markers. # -rc markers.
version = f.read().strip().split("-")[0] dangerzone_version = f.read().strip().split("-")[0]
dangerzone_product_upgrade_code = "12b9695c-965b-4be0-bc33-21274e809576"
dist_dir = os.path.join( dist_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
@ -118,7 +120,7 @@ def main():
"Package", "Package",
Name="Dangerzone", Name="Dangerzone",
Manufacturer="Freedom of the Press Foundation", Manufacturer="Freedom of the Press Foundation",
UpgradeCode="$(var.ProductUpgradeCode)", UpgradeCode=dangerzone_product_upgrade_code,
Language="1033", Language="1033",
Compressed="yes", Compressed="yes",
Codepage="1252", Codepage="1252",
@ -128,7 +130,7 @@ def main():
package_el, package_el,
"SummaryInformation", "SummaryInformation",
Keywords="Installer", Keywords="Installer",
Description="Dangerzone $(var.ProductVersion) Installer", Description="Dangerzone " + dangerzone_version + " Installer",
Codepage="1252", Codepage="1252",
) )
ET.SubElement(package_el, "MediaTemplate", EmbedCab="yes") ET.SubElement(package_el, "MediaTemplate", EmbedCab="yes")
@ -226,8 +228,6 @@ def main():
ET.SubElement(feature_el, "ComponentGroupRef", Id="ApplicationComponents") ET.SubElement(feature_el, "ComponentGroupRef", Id="ApplicationComponents")
ET.SubElement(feature_el, "ComponentRef", Id="ApplicationShortcuts") ET.SubElement(feature_el, "ComponentRef", Id="ApplicationShortcuts")
print(f'<?define ProductVersion = "{version}"?>')
print('<?define ProductUpgradeCode = "12b9695c-965b-4be0-bc33-21274e809576"?>')
ET.indent(wix_el, space=" ") ET.indent(wix_el, space=" ")
print(ET.tostring(wix_el).decode()) print(ET.tostring(wix_el).decode())