7
votes

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.

1
This project may provide some assistance: msiext.codeplex.com - biscuit314
It would be helpful if you point out which .msi project or example i can refer to. I downloaded the files and it does not contain .wxs files. Am I looking at the wrong files? Thanks. - cynthia hong
The project contains extensions for Wix including System Tools, Data Tools, User Privileges, Data Sources, and Common UI. There is a section on the page I linked to which goes into a bit of detail on each, with further links for more information. You will be most interested in the second screen shot here (msiext.codeplex.com/…) and maybe the extensions described here (code.dblock.org/msi-community-extensions-deploying-databases), and the full documentation is here (msiext.codeplex.com/documentation) - biscuit314

1 Answers

1
votes

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>