Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add test sql connection button in Wix

I need to add a test sql connection button in Wix. When the button is clicked, it can check if the sql connection can be establish. And if it fails it can pop up an error dialog and remain at the same page when the error dialog closes (and not exit the installation). May i know if there is a pre-existing wix command or custom action using command line that i can use. I'm trying not to accomplish this using writing my own custom action dll.

Thanks in advance.

like image 782
cynthia hong Avatar asked Feb 02 '12 03:02

cynthia hong


1 Answers

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

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

Here InvalidConn is a dialog

<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>
like image 188
Vinay Kumar Avatar answered Nov 02 '22 04:11

Vinay Kumar