0
votes

I have a ASP.NET Core web application that uses Wix to install and uninstall.

When I uninstall the MSI from program and features I wanted to create a confirmation dialog (yes/no) the moment I click remove this application on program and features.

Is it possible to add a dialog before the msi starts to uninstall.

If I click yes on the dialog the msi just continues to uninstall

If I click no the msi exists and doesnt uninstall

1

1 Answers

0
votes

Background Information: About the Add / Remove Programs Buttons (towards bottom).


Default: I do get an "are you sure you want to uninstall" dialog before I get the UAC elevation prompt when trying to uninstall WiX MSI files at least? There is a "do not show this dialog again" check box though. Windows 10.

Silent Mode: The problem with what you ask is that you run the uninstall in silent mode when you invoke it from the Uninstall button in the ARP applet. This means that the entire InstallUISequence is skipped and only the InstallExecuteSequence runs - and there should be no dialogs shown from this sequence.

Options: I can think of a couple of options off the top of my head.

  • Breaking Radio Silence: You can insert a custom action showing a prompt in the InstallExecuteSequence anyway, but it is not recommended. You would have to condition it very well to make sure it does not show up unexpectedly. That would entail detecting that it is not a major upgrade and a number of other things I would not recommend trying. Too many things to work out and too much that can go wrong.
  • Modify Button Only: You can hide the Uninstall button and just leave "Modify" in place in the ARP applet dialog?

    • That way your setup will be triggered in GUI mode, and you can insert a dialog there if you want to, but you also have plenty of opportunity to cancel the Uninstall before it is invoked. You don't even need an extra dialog?

    • To achieve this, set in Property Table: ARPNOREPAIR = 1 and ARPNOREMOVE = 1.


Links: