0

I need to end my installation early based on a certain condition, after displaying the Welcome Dialog, then a custom message dialog (already written) explaining why the installer is exiting. Here's my code:

    <Publish Dialog="WelcomeDlg" Control="Next" Event="DoAction" Value="CheckForCondition" Order="1">1</Publish>
    <Publish Dialog="WelcomeDlg" Control="Next" Event="SpawnDialog" Value="ConditionExistsMsgDlg" Order="2">CONDITIONEXISTS = "1"</Publish>
    <Publish Dialog="WelcomeDlg" Control="Next" Event="?????" Value="??????" Order="3">CONDITIONEXISTS = "1"</Publish>
    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="AfterWelcomeDlg" Order="4">CONDITIONEXISTS = "0"</Publish>

What goes in the Event and Value fields in Order=3? I tried WixExitEarlyWithSuccess CA, but that did indicate an error. I'd like to just go to some sort of Finished dialog without MSI informing the user that there was an error. Is this possible?

wade
  • 65
  • 1
  • 7
  • Just to clarify things, do you want to show AfterWelcomeDlg when CONDITIONEXISTS = "0"? And here, you expect to have a finish button to exit the installer? – sohil May 10 '12 at 10:57
  • If CONDITIONEXISTS = "0", I expect the installation to proceed normally. That dialog can be any dialog (SetupTypeDlg, for example), but in my case it's a custom one. If CONDITIONEXISTS = "1", I'd like to show an exit dialog of some sort that doesn't indicate an error. – wade May 10 '12 at 12:47
  • What is the role of ConditionExistsMsgDlg here? Is this the custom message dialog you want to show to the user before the installer exits? – sohil May 11 '12 at 07:15
  • Yes. Hmmm, can't respond just "Yes"? – wade May 11 '12 at 12:33
  • If the ConditionMsgDlg is the final dialog, you don't need both the 2nd and the 3rd lines in your code above. Having a NewDialog event with value ConditionMsgDlg should be enough. – sohil May 14 '12 at 07:13

2 Answers2

1

The Event should be NewDialog and the Value should be the custom dialog you want to show (some sort of Finished dialog), for example, CustomExitDlg.

You will also need to ensure that the installer returns after clicking Finish (or some other button that you've defined on your custom final screen). This is the standard rule for the default WiX install UIs:

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
sohil
  • 508
  • 1
  • 3
  • 14
  • Just making an Event of "EndDialog" and a value of "Return" for a button ends the installation? – wade May 11 '12 at 12:38
  • I haven't tried it myself, but it certainly seems so. Your final dialog should have this event for the Finish button. – sohil May 14 '12 at 07:11
1

In the Tutorial it is stated that returning from a dialog with "Return" resumes normal operation (what a Cancel button would do) whereas "Exit" is used to abort the whole installation process.. most likely the dialog UserExit.wxs will be linked to this (via OnExit="cancel"!) and show up depending on which dialog set you are using. If you don't want anythig to show up after "Exit" you need to remove UserExit from your UI..

You can download the Wix Toolset sources (wixXY-debug.zip) and take a look into the folder "..\src\ext\UIExtension\wixlib" if you want to see how it is done in the standard dialogs e.g. UserExit.wxs.

A.J.Bauer
  • 2,803
  • 1
  • 26
  • 35