SQL Server Browse (ISqlServerBrowse)
Overview
The SQL Server Browse operation discovers SQL Servers/instances and exposes the results to Windows Installer properties and optional UI controls. Use it to let users select a server at install time, then pass the selected value to your connections, queries, or scripts.
This object is created under SqlDatabasesComponent and appears in the SQL Server Browse tab in Advanced Installer.
Methods
- (No methods available for ISqlServerBrowse)
Properties
- Name (string) {get}{set} Gets or sets the display name of this browse operation.
- BrowseType (string) {get}{set} Gets or sets the browse mode used to discover servers/instances (e.g., Network or other supported values for your project).
- ResultPropertyName (string) {get}{set} Gets or sets the installer property that will receive the selected server/instance string.
- ComboBoxControlPropertyName (string) {get}{set} Binds the browse results to the specified MSI ComboBox control property (for UI population).
- ListControlPropertyName (string) {get}{set} Binds the browse results to the specified MSI List control property (alternative to ComboBox).
- OutputFormatInstance (bool) {get}{set} When true, includes the instance name in the formatted output string.
- OutputFormatVersion (bool) {get}{set} When true, includes the server version in the formatted output string.
- OutputFormatLocation (bool) {get}{set} When true, includes the server location in the formatted output string.
- OutputFormatClustered (bool) {get}{set} When true, includes whether the server is clustered in the formatted output string.
- IsVerbose (bool) {get}{set} Enables verbose logging for this browse operation when true.
- Object (uint) {get} Read-only internal identifier for this browse operation instance.
Sample commands
# SQL Operations - SQL Server Browse $advinst = New-Object -ComObject "AdvancedInstaller" $project = $advinst.CreateProject($advinst.ProjectTypes.Enterprise) # Create a Server Browse operation $browseServer = $project.SqlDatabasesComponent.NewBrowseServer("Browse Server Connection") # Configure browse behavior and output binding $browseServer.BrowseType = "Local" # Supported values: Network Local Domain $browseServer.ResultPropertyName = "SELECTED_SERVER" $browseServer.ComboBoxControlPropertyName = "SERVER_COMBOBOX" # or use a list control: # $browseServer.ListControlPropertyName = "SERVER_LIST" # Control what the formatted output contains $browseServer.OutputFormatInstance = $true $browseServer.OutputFormatVersion = $true $browseServer.OutputFormatLocation = $false $browseServer.OutputFormatClustered = $false $browseServer.IsVerbose = $true $project.SaveAs("F:\cmdlet\output\Server Browse.aip")