mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Change: Wrap ProgramFilesFolder
component with a StandardDirectory
component
This commit is contained in:
parent
4638444290
commit
abb71e0fe5
1 changed files with 28 additions and 27 deletions
|
@ -67,20 +67,19 @@ def build_components_xml(root, data):
|
||||||
if "component_id" in data:
|
if "component_id" in data:
|
||||||
component_ids.append(data["component_id"])
|
component_ids.append(data["component_id"])
|
||||||
|
|
||||||
for subdata in data["dirs"]:
|
if "component_guid" in data:
|
||||||
if "component_guid" in subdata:
|
dir_ref_el = ET.SubElement(root, "DirectoryRef", Id=data["id"])
|
||||||
dir_ref_el = ET.SubElement(root, "DirectoryRef", Id=subdata["id"])
|
|
||||||
component_el = ET.SubElement(
|
component_el = ET.SubElement(
|
||||||
dir_ref_el,
|
dir_ref_el,
|
||||||
"Component",
|
"Component",
|
||||||
Id=subdata["component_id"],
|
Id=data["component_id"],
|
||||||
Guid=subdata["component_guid"],
|
Guid=data["component_guid"],
|
||||||
)
|
)
|
||||||
for filename in subdata["files"]:
|
for filename in data["files"]:
|
||||||
file_el = ET.SubElement(
|
file_el = ET.SubElement(
|
||||||
component_el, "File", Source=filename, Id="file_" + uuid.uuid4().hex
|
component_el, "File", Source=filename, Id="file_" + uuid.uuid4().hex
|
||||||
)
|
)
|
||||||
|
for subdata in data["dirs"]:
|
||||||
component_ids += build_components_xml(root, subdata)
|
component_ids += build_components_xml(root, subdata)
|
||||||
|
|
||||||
return component_ids
|
return component_ids
|
||||||
|
@ -106,25 +105,13 @@ def main():
|
||||||
print("You must build the dangerzone binary before running this")
|
print("You must build the dangerzone binary before running this")
|
||||||
return
|
return
|
||||||
|
|
||||||
data = {
|
# Prepare data for WiX file harvesting from the output of cx_Freeze
|
||||||
"id": "TARGETDIR",
|
data = build_data(
|
||||||
"name": "SourceDir",
|
|
||||||
"dirs": [
|
|
||||||
{
|
|
||||||
"id": "ProgramFilesFolder",
|
|
||||||
"dirs": [],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
data["dirs"][0]["dirs"].append(
|
|
||||||
build_data(
|
|
||||||
dist_dir,
|
dist_dir,
|
||||||
"exe.win-amd64-3.12",
|
"exe.win-amd64-3.12",
|
||||||
"INSTALLFOLDER",
|
"INSTALLFOLDER",
|
||||||
"Dangerzone",
|
"Dangerzone",
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
# Add the Wix root element
|
# Add the Wix root element
|
||||||
wix_el = ET.Element("Wix", xmlns="http://wixtoolset.org/schemas/v4/wxs")
|
wix_el = ET.Element("Wix", xmlns="http://wixtoolset.org/schemas/v4/wxs")
|
||||||
|
@ -224,8 +211,22 @@ def main():
|
||||||
KeyPath="yes",
|
KeyPath="yes",
|
||||||
)
|
)
|
||||||
|
|
||||||
build_dir_xml(package_el, data)
|
# Add the ProgramFilesFolder StandardDirectory
|
||||||
component_ids = build_components_xml(package_el, data)
|
programfilesfolder_el = ET.SubElement(
|
||||||
|
package_el,
|
||||||
|
"StandardDirectory",
|
||||||
|
Id="ProgramFilesFolder",
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create the directory structure for the installed product
|
||||||
|
build_dir_xml(programfilesfolder_el, data)
|
||||||
|
|
||||||
|
# Create a component group for application components
|
||||||
|
applicationcomponents_el = ET.SubElement(
|
||||||
|
package_el, "ComponentGroup", Id="ApplicationComponents"
|
||||||
|
)
|
||||||
|
# Populate the application components group with components for the installed package
|
||||||
|
build_components_xml(applicationcomponents_el, data)
|
||||||
|
|
||||||
# Add the Feature element
|
# Add the Feature element
|
||||||
feature_el = ET.SubElement(package_el, "Feature", Id="DefaultFeature", Level="1")
|
feature_el = ET.SubElement(package_el, "Feature", Id="DefaultFeature", Level="1")
|
||||||
|
|
Loading…
Reference in a new issue