How to add a test SQL connect button in Wix

I need to add a sql connection test button in Wix. When the button is pressed, it can check if the sql connection can be established. And if this fails, it may display an error dialog box and remain on the same page when the error dialog closes (and does not exit the installation). Can I find out if a pre-existing wix command exists or a custom action using the command line that I can use. I try not to do this by writing my own DLL of my own action.

Thanks in advance.

+7
source share
1 answer

You can use a session variable that will set if the SQL connection fails and vice versa. then use SpawnDialog to display a pop-up dialog box with an error message. Example:

<Publish Event="SpawnDialog" Value="InvalidConn">DBCONNACCEPTED = "0"</Publish> 

Here InvalidConn is a dialogue

 <Dialog Id="InvalidConn" Width="260" Height="120" Title="[ProductName]"> <Control Id="OK" Type="PushButton" X="102" Y="90" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK"> <Publish Event="EndDialog" Value="Return">1</Publish> </Control> <Control Id="Text" Type="Text" X="48" Y="22" Width="194" Height="60" Text="[ErrorText]" /> <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="Information icon" FixedSize="yes" IconSize="32" Text="WixUI_Ico_Info" /> </Dialog> 
+1
source

All Articles