0

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 Answers1

0

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:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thanks for the response, I only get the "Are you sure you want to uninstall" dialog when uninstalling the MSI on the desktop. But when I go to program and features I dont get that dialog and it just uninstalls witha progress bar dialog. What im trying to do is click on remove program and then create my own dialog with the company logo saying yes/no" – Calidreaminn Mar 15 '19 at 17:47
  • Maybe try adding **`ARPNOREPAIR = 1`** and **`ARPNOREMOVE = 1`** to the property table of your MSI. Install and then see what you think about what you see in Add / Remove Programs. Either update the MSI with Orca, or compile a new MSI adding [Property Elements](http://wixtoolset.org/documentation/manual/v3/xsd/wix/property.html) under the Product element: `` – Stein Åsmul Mar 15 '19 at 17:50
  • I just need to create a custom dialog asking yes or no with my company logo, is Orca the best way to do that? Just a yes/no dialog the moment I click uninstall from program features – Calidreaminn Mar 15 '19 at 18:13
  • so its impossible to create a yes/no dialog the moment i click uninstall on my msi from program and features? – Calidreaminn Mar 15 '19 at 19:40
  • No, just not advisable for the reason I state in the answer above. To do so you can use a custom action though - if you are familiar with that concept. You can even to a VBScript dialog [ala this](https://stackoverflow.com/a/48106587/129130). **What is the distribution scope for your MSI? Is it very small**? – Stein Åsmul Mar 15 '19 at 19:48
  • @Calidreaminn I hope it was clear that it is sufficient to leave the modify button in Add / Remove programs because you can use the main MSI dialogs to invoke the uninstall - provided the MSI has a proper GUI in it. – Stein Åsmul Mar 16 '19 at 13:46
  • Thanks for the feedback, the company I work for asked me to create a yes/no dialog before the uninstall sequence starts. Im not sure about the distribution scope but right now I created a VB script and I now have a yes/no dialog. – Calidreaminn Mar 18 '19 at 12:55
  • If I click Yes or No how would I exit or continue the execution of the MSI installer. If I click no Id like to just stop uninstalling. – Calidreaminn Mar 18 '19 at 12:57
  • I added [a link in a previous comment](https://stackoverflow.com/a/48106587/129130) that you should check out for information on this. – Stein Åsmul Mar 22 '19 at 05:15