cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
pradana
Level 6

Populate ListBox

Is it possible to populate a ListBox programatically with InstallScript?

What value should be passed to the ListBox property to get it populated?

Thanks.
Labels (1)
0 Kudos
(10) Replies
enGenius
Level 4

The CtrlSetList function places the contents of a string list into the specified single- or multi-selection list box or combo box control. Any pre-existing contents are replaced with the items contained in listID. InstallShield places each element of the string list into each element of the list box or combo box control.

Syntax
CtrlSetList (szDialogName, nControlID, listID);

Parameters
CtrlSetList Parameters
Parameter
Description

szDialogName
Specifies the name of a dialog that contains the list box or combo box.

nControlID
Specifies the resource ID of the list box or combo box.

listID
Specifies the name of a string list that contains the elements to be copied into the list box or combo box control.
0 Kudos
RobertDickau
Flexera Alumni

And for Basic MSI dialogs, please see the InstallShield help topic "Windows Installer API Functions Example".
0 Kudos
pradana
Level 6

Thanks for your replies!

I think I've managed to get them populated by manipulating the 'ListBox' MSI table at runtime, using Installscript.
0 Kudos
Paul6151
Level 5

Hello!

How did you do it? I find it hard to populate. it doesnt work using CtrlSetList.
I was trying to populate by design time, but it doesnt work too.


How bout the parameter:

szDialogName
Specifies the name of a dialog that contains the list box or combo box.


Where can i find this name?

I am using IS 2010
0 Kudos
RobertDickau
Flexera Alumni

What kind of project? Is this a custom dialog or a standard dialog? The function is intended for a custom InstallScript dialog box, where szDialog is the string dialog nickname that you pass to EzDefineDialog, WaitOnDialog, and so on.
0 Kudos
Paul6151
Level 5

This is an installscript project
a custom dialog

// Create language list
listLanguage = CreateLanguageList();
if (listLanguage = LIST_NULL) then
MessageBox ("Unable to create list of languages", SEVERE);
abort;
endif;

// Place the list of colors into the dialog's list box.
nResult = CtrlSetList (szDialogName, SD_DLG_SEL_LANG_LIST, listLanguage);



the nResult here is not equal to 0.
0 Kudos
RobertDickau
Flexera Alumni

Does that resource ID SD_DLG_SEL_LANG_LIST definitely match up? (The comment mentions a color list and not a language list...?) For testing, can you pass the list to SdShowInfoList?
0 Kudos
Paul6151
Level 5

The comment about 'color' is a mistake. it really means 'language', but if forgot to change it.

i tried SdShowInfoList. The list works.
The problem lies in CtrlSetList i think.

The SD_DLG_SEL_LANG_LIST matches up.. This is supposed to be the resource identifier of the Listbox, right?
0 Kudos
mjcapco
Level 2

Hi

can someone help me show how to perform silent install , im using below parameters and yet its not working

Recording
C:\qvtnet5.0\setup.exe /a /r /f1C:\Temp\Setup.iss
Install silently
start /wait C:\qvtnet5.0\setup.exe /s /a /s /sms /f1"C:\Temp\Setup.iss"
0 Kudos
Paul6151
Level 5

@mjcapco:

hi!

I think you missed to post your query in the right thread (?)

this thread is all about ListBox.
0 Kudos