Hello,
I'm building an installer to a .NET application using Advanced Installer Enterprise 8.0.2.
I added a dialog to the "First Time Install" in which I'm trying to achieve the following behavior:
1) Check if the host computer is running an SQL server with instance name TestSQL, has a DB named TestDB and a table named TestTable.
2) If the answer to (1) is NO, I'd like to search the local network for SQL servers and display the found servers in an editable comboBox for the user to select or enter the server.
3) Test the selected server for the same parameters as in (1) (SQL-Instance-Name + DB + Table).
4) Progress with the installation only in case a valid server was found.
This process should be performed before the files deployment (before the ProgressDlg dialog) and so, any Custom Action should be an attached one.
I read this answer (http://www.advancedinstaller.com/user-g ... ction.html) about an SQL connection however, as I understood it is not possible to suppress the error message displayed in case the connection is not valid (Not having the DB on the local-host is a perfectly valid condition and I don't want an error message displayed).
My installed project does not have unmanaged code and I do not want to add and have to maintain an unmanaged DLL just for a Custom Action that tests an SQL connection.
I could not find a straightforward way to call a function in an attached .NET DLL and get the return code in a property.
Also, the overall approach of using .NET DLLs is problematic as you'd need a separate DLL for every C.A. function you'd require. I could not find a way to specify the class-name implementing Installer so if that's correct, there can be only one function of a kind in a DLL (one "install", one "commit", etc.).
Please advise.
Thanks.
FOLLOW US
Get the latest news in Application Packaging