Avoid going to the next dialog with the condition for installing WiX

Does anyone know if / how I can stop the WiX-based MSI installer by moving to the next dialog box when a certain condition is met? I have the following code:

<Dialog Id="SelectIISApplicationPoolUserDialog" Width="370" Height="270" Title="$(var.ApplicationPoolUserDialogTitle)"> <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"> <Publish Property="APPLICATIONPOOLUSER" Value="{}">WEBSITE_APPLICATIONPOOLUSERTYPE = "local"</Publish> <Publish Property="APPLICATIONPOOLUSER" Value="1">WEBSITE_APPLICATIONPOOLUSERTYPE = "domain"</Publish> <Publish Event="DoAction" Value="CheckPortNumber">1</Publish> </Control> 

CheckPortNumber refers to this:

 <Binary Id="IISCA" SourceFile="binaries/MyCustomActions.IIS.CA.dll" /> <CustomAction Id="CheckPortNumber" BinaryKey="IISCA" DllEntry="IsFreePort" Execute="immediate" /> 

In addition, in another place, we announce the following:

 <Publish Dialog="SelectIISApplicationPoolUserDialog" Control="Next" Event="NewDialog" Value="SetSqlServerConnectionDialog">ISPORTFREE</Publish> 

When I run the installer and go to the dialog box to select the application pool user, click Next. The user action then checks the port number and sets the ISPORTFREE variable. However, the following dialog is not displayed, regardless of the result of ISPORTFREE. But when I click "Next" a second time, the following dialog is displayed.

So, I want: when I click the "Next" button, and the entered number of ports is used, I get a warning and do not proceed to the next dialog box. If it is not used, go to the next dialog.

+4
source share
1 answer

You need to install Publish/@Order so that everything is priced in the correct order.

Perhaps something like the following:

 <Publish Dialog="MyDlg" Control="Next" Event="DoAction" Value="SomeAction" Order="1">1</Publish> <Publish Dialog="MyDlg" Control="Next" Event="SpawnDialog" Value="MyWarningDlg" Order="2">Not CONDITION</Publish> <Publish Dialog="MyDlg" Control="Next" Event="NewDialog" Value="MyOtherDlg" Order="3">CONDITION</Publish> 
+8
source

All Articles