huangzhihua
Posts: 2
Joined: Thu Feb 05, 2026 3:53 am

How to dynamically populate a ComboBox list at runtime (MSI UI)? INSERT into ComboBox table is not supported

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!
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: How to dynamically populate a ComboBox list at runtime (MSI UI)? INSERT into ComboBox table is not supported

Hello and welcome to our forums,

Some time ago, I've written an article that explains how to achieve exactly this (except that it uses a PowerShell script)

Populate CheckList / ComboBox / ListBox controls with values received from a custom script

Hope it helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7664
Joined: Wed Jun 13, 2018 7:49 am

Re: How to dynamically populate a ComboBox list at runtime (MSI UI)? INSERT into ComboBox table is not supported

You are always welcome!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”