Hi all,
I’m using Advanced Installer (v18.6.1) and I would like to dynamically load the drop-down items of a ComboBox in an MSI dialog during install UI (e.g., populate the list based on runtime data).
I tried to do this via a C# Managed Custom Action (DTF) by inserting rows into the MSI ComboBox table at runtime, but it seems this operation is blocked / not supported.
Here is my custom action:
[CustomAction]
public static ActionResult GetCompanyList(Session session)
{
try
{
using (var db = session.Database)
{
string insertSql =
"INSERT INTO ComboBox (Property, [Order], Value, Text) " +
"VALUES ('COMBOBOX_TABLE_PROP', 1, 'CompanyA', 'CompanyA')";
using (var view = db.OpenView(insertSql))
{
view.Execute();
}
}
session.Log("ComboBox data fill completed");
return ActionResult.Success;
}
catch (Exception ex)
{
session.Log("ERROR in PopulateComboBox: " + ex.Message);
return ActionResult.Failure;
}
}
However, at runtime I get the following error:
MSI (c) (2C!3C) [17:01:55:993]: Note: 1: 2232 2: 3: Order 4: INSERT INTO ComboBox (Property, Order, Value, Text) VALUES ('COMBOBOX_1_PROP', 1, 'CompanyA', 'CompanyA')
ERROR in PopulateComboBox: SQL The query syntax is incorrect or not supported.
My questions:
Is it possible to dynamically populate an MSI ComboBox at runtime in Advanced Installer?
If inserting into the MSI database tables (ComboBox table) is not supported during installation, what is the recommended approach to achieve a dynamic drop-down list?
Would the correct solution be a custom UI (WinForms/WPF) dialog, or is there another MSI-friendly method (properties, AppSearch, etc.)?
Any guidance or examples would be appreciated.
Thanks!
FOLLOW US