Skip to content

Commit

Permalink
Fix: Dangerzone installed using an msi built with WiX Toolset v3 is n…
Browse files Browse the repository at this point in the history
…ot uninstalled by an msi built with WiX Toolset v5

Fix the issue by adding some extra functionality to the "Next" button on the welcome screen of the installer. When the user clicks it to proceed with the installation this:
1. Flips the install scope to "perUser" which is the default in WiX v3
2. Finds the older installation
3. And finally flips the scope back to "perMachine" which is the default in WiX v4 and newer

TODO: Revert this once we are reasonably certain there are no affected Dangerzone Installations?
  • Loading branch information
jkarasti committed Nov 11, 2024
1 parent 58db3bc commit ef00347
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions install/windows/build-wxs.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,43 @@ def main():
)
ET.SubElement(ui_el, "UIRef", Id="WixUI_ErrorProgressText")

# Workaround for an issue after upgrading from WiX Toolset v3 to v5 where the older
# version of Dangerzone is not uninstalled during the upgrade
#
# Fix the issue by adding some extra functionality to the "Next" button on the welcome screen
# of the installer. When the user clicks it to proceed with the installation this:
# 1. Flips the install scope to "perUser" which is the default in WiX v3
# 2. Finds the older installation
# 3. And finally flips the scope back to "perMachine" which is the default in WiX v4 and newer
#
# Adapted from this stack overflow answer: https://stackoverflow.com/a/35064434
#
# TODO: Revert this once we are reasonably certain there are no affected Dangerzone Installations?
ET.SubElement(
ui_el,
"Publish",
Dialog="WelcomeDlg",
Control="Next",
Property="ALLUSERS",
Value="{}",
)
ET.SubElement(
ui_el,
"Publish",
Dialog="WelcomeDlg",
Control="Next",
Event="DoAction",
Value="FindRelatedProducts",
)
ET.SubElement(
ui_el,
"Publish",
Dialog="WelcomeDlg",
Control="Next",
Property="ALLUSERS",
Value="1",
)

# Add the ProgramMenuFolder StandardDirectory
programmenufolder_el = ET.SubElement(
package_el,
Expand Down

0 comments on commit ef00347

Please sign in to comment.