0

I'm having trouble displaying a dialog during the uninstall sequence that runs from the shortcut and add/remove programs with basic UI. It seems to be skipping the InstallUISequence that is shown during modify and install:

<!--Displays uninstall options before uninstall progress dialog WixUI_InstallMode = "Remove"-->
<InstallUISequence>
    <Show Dialog="UninstallDialog" Before="ProgressDlg">WixUI_InstallMode = "Remove"</Show>
</InstallUISequence>

However, it is important I get this dialog running during the basic uninstall sequence as well. Is it possible to show dialogs defined in WiX from the C# custom action run from the InstallExecuteSequence? If so, how would I go about doing this? Are there any tutorials? The dialog I would like to show can be seen below:

<!--Dialog used to obtain uninstall options from user-->
<Dialog Id="UninstallDialog" Width="120" Height="100" Title="Options">
    <Control Id="DelDatabaseCheckBox" Type="CheckBox"
             X="15" Y="10" Width="90" Height="17" Property="DELDATABASE"
             CheckBoxValue="1" Text="Delete Database"/>

    <Control Id="DelSettingsCheckBox" Type="CheckBox"
             X="15" Y="30" Width="90" Height="17" Property="DELSETTINGS"
             CheckBoxValue="1" Text="Delete Settings"/>

    <Control Id="DelErrorLogCheckBox" Type="CheckBox"
             X="15" Y="50" Width="90" Height="17" Property="DELERRORLOG"
             CheckBoxValue="1" Text="Delete Error Log"/>

    <Control Id="ConfirmUninstall" Type="PushButton" X="22" Y="75" Width="70" Height="17" Text="Ok">
        <Publish Event="EndDialog" Value="Return">1</Publish>
    </Control>
</Dialog>
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user1410668
  • 245
  • 3
  • 6
  • 16
  • Possible duplicate of http://stackoverflow.com/questions/4838526/wix-launch-dialog-on-uninstall – BryanJ Jan 14 '13 at 15:55
  • No I fully understand that it doesn't show the UI by itself. I mentioned this. That is why I would like to force it to show during the c# customaction i developed since I know for sure that it is running that during uninstall. Is there some command you can use with session to do this? – user1410668 Jan 14 '13 at 15:57

1 Answers1

5

What you are trying to do is an antipattern. Instead disable the Remove button and force the user to go through the Change | Remove story. You can display native MSI UI there.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • 1 http://msdn.microsoft.com/en-us/library/windows/desktop/aa367591(v=vs.85).aspx – Christopher Painter Jan 14 '13 at 19:17
  • The problem with that though is that it is also disabling the remove button in the GUI. – user1410668 Jan 14 '13 at 19:21
  • Personally I would prefer a solution that would simply cause the msiexec /i sequence to start running when the add/remove button is double clicked. This will open the configuration screen allowing the user to choose to add/remove in the GUI – user1410668 Jan 14 '13 at 19:26
  • 1
    "Instead disable the Remove button" is exactly what I said in my answer. Microsoft designed the Remove button to be a /QB LIMITUI operation. – Christopher Painter Jan 14 '13 at 19:57