Reputation: 65
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?
Upvotes: 0
Views: 2196
Reputation: 3001
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.
Upvotes: 1
Reputation: 508
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>
Upvotes: 1