Does InstallBuilder have any built-in ability to test a connection to a database using the credentials entered?

asked 15 Mar '12, 16:33

bstoke's gravatar image

accept rate: 0%

InstallBuilder do not have a built-in method to validate the connection but you could call the client binary from a <runProgram> action:

                                <setInstallerVariable name="connection_validated" value="0" />
                                    <programArguments>-U${mssql_root_user} -P${mssql_root_password} -S${mssql_dsn} -Q "exit"</programArguments>
                                <setInstallerVariable name="connection_validated" value="1" />
                            <text>Unable to connect to database ${mssql_dsn} as a ${mssql_root_user} database user. Please check your configuration.</text>
                                <isFalse value="${connection_validated}" />

Where mssql_dsn would be ${env(COMPUTERNAME)}\\${mssql_instance} and the mssql_instance can be the result of a choiceParameter, populated from the registry:

  <rootKey>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\Instance Names\\SQL</rootKey>
  <variables>key name value</variables>

answered 16 Mar '12, 06:10

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 15 Mar '12, 16:33

Seen: 1,611 times

Last updated: 16 Mar '12, 06:10