Skip to content

Commit 86179d4

Browse files
committed
Fix: Dangerzone installed using an msi built with WiX Toolset 3 is not uninstalled by an msi built with WiX Toolset 5
Work around 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 3 2. Finds the older installation 3. And finally flips the scope back to "perMachine" which is the default in WiX 4 and newer TODO: Revert this once we are reasonably certain there are no affected Dangerzone Installations?
1 parent 3e1c70a commit 86179d4

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

install/windows/build-wxs.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,43 @@ def main():
163163
)
164164
ET.SubElement(ui_el, "UIRef", Id="WixUI_ErrorProgressText")
165165

166+
# Workaround for an issue after upgrading from WiX Toolset 3 to 5 where the older
167+
# version of Dangerzone is not uninstalled during the upgrade
168+
#
169+
# Work around the issue by adding some extra functionality to the "Next" button on the welcome screen
170+
# of the installer. When the user clicks it to proceed with the installation this:
171+
# 1. Flips the install scope to "perUser" which is the default in WiX 3
172+
# 2. Finds the older installation
173+
# 3. And finally flips the scope back to "perMachine" which is the default in WiX 4 and newer
174+
#
175+
# Adapted from this stack overflow answer: https://stackoverflow.com/a/35064434
176+
#
177+
# TODO: Revert this once we are reasonably certain there are no affected Dangerzone Installations?
178+
ET.SubElement(
179+
ui_el,
180+
"Publish",
181+
Dialog="WelcomeDlg",
182+
Control="Next",
183+
Property="ALLUSERS",
184+
Value="{}",
185+
)
186+
ET.SubElement(
187+
ui_el,
188+
"Publish",
189+
Dialog="WelcomeDlg",
190+
Control="Next",
191+
Event="DoAction",
192+
Value="FindRelatedProducts",
193+
)
194+
ET.SubElement(
195+
ui_el,
196+
"Publish",
197+
Dialog="WelcomeDlg",
198+
Control="Next",
199+
Property="ALLUSERS",
200+
Value="1",
201+
)
202+
166203
ET.SubElement(
167204
package_el,
168205
"WixVariable",

0 commit comments

Comments
 (0)