0

I need to add a dialog box that would pop up during complete uninstall (not major upgrade) right after the confirmation ("Are you sure you want to uninstall this product?") dialog. This dialog would prompt the user to answer a question and based on the response, set up a property that would be used in the condition for the RemoveRegistryKey element (i.e. it will remove a registry key only if the user selects an option to delete the key).

I have an idea how to add a dialog to the install sequence (I am using a modified WixUI_InstalLDir sequence to which I added a custom dialog I need during installation), but I can't find any references that would explain how to add a custom dialog to an uninstall sequence. It would be even better if I could modify the uninstall confirmation dialog, so the user would see one dialog instead of two. An the key thing would be to be able to set up a property that could be used in the component condition.

Is this possible? Are there any examples how to do this?

Alek Davis
  • 10,628
  • 2
  • 41
  • 53

1 Answers1

1

This is against Microsoft design guidelines. Add/Remove programs calls the uninstall with a silent UI argument and the UI sequence is never processed.

The only place you can author UI during an uninstall is a "change" or "maintenance" UI experience where they select Repair | Change | Remove and on Remove do your UI. But you'd have to lock down the Remove buttom and force them through this path. Also realize they could call msiexec /x /qb from the command line.

Bottom line is Microsoft made this choice to make the uninstall process simple and easy for the user. As for removing the registry key, Microsoft would say that you should leave user data on uninstall.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Thanks for the explanation, Christopher. So, the confirmation prompt comes from the Add/Remove Programs and not from the MSI, since if it runs in silent mode, I'd not expect to see any dialogs, including the confirmation prompt, right? (RANT: Since you can run installer with a silent switch in any mode, by the same logic, Microsoft should not allow any UI during initial installation either. I don't see what would be wrong for the MSI developer to detect silent install and suppress any UI during uninstall just as it should be done during installs. Boo, Microsoft.) – Alek Davis Oct 03 '13 at 00:20
  • Correct. The initial prompt is from ARP and then the MSI is invoked silently. You can suppress the ARP entry using the ARPSYSTEMCOMPONENT property and then implement your own entries with your own invocation but this was the default best practice story they invisioned. Think of it like deleting an app from an iPhone. Press X and it's gone. No take me to my website.... blah blah blah. – Christopher Painter Oct 03 '13 at 01:05
  • The only problem with this logic is that on uninstall apps who save configuration in the registry or configuration files would not know whether to remove app data or keep it. Think of any media viewer app, like VLC, MPC-HC, codec packs. A user may want to uninstall the app, temporarily, without losing configuration data, or delete data, too. If there is no way to ask user, it'd be safer to keep data, but this would result in bloated registry and files system with entries files that are not needed. Good thing for registry cleaner apps, but bad for everybody else. Thanks again for the answer. – Alek Davis Oct 03 '13 at 02:29
  • Keeping user data or not is a interesting question. when the user is using his profile on different computers, you cannot decide delete the settings or not. You don't know if the software is installed on other computers and if he need that setting on different machines. – coding Bott Oct 04 '13 at 08:00