Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Populating a Listbox from a Custom Action


4 replies to this topic

Hasse

Hasse
  • Members
  • 2 posts

Posted 12 February 2001 - 13:35

I have a Custom Action that calls a VBScript. The script returns several strings.
I wonder how I populate a Listbox with these strings?
Probably should I put the strings in the property table and transfer them into the Listbox, but how?
Thanks in advance
Hasse


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 February 2001 - 08:05

You would have to add temporary rows to the ListBox table on the fly, before you display the dialog with the list box control.

Bertrand

Bertrand
  • Members
  • 13 posts

Posted 13 February 2001 - 11:31

Hi,

I had the same problem. Hopefully N.roger (a nice guy) helps me.
I insert a part of his answer (we both are  french), the most important : the code snippet.

Quote

function FillCombo(hMsi)
// Declaration View and Base Handle

NUMBER hDatabase,hCBOView,hRec;
STRING sQuery;

begin

hDatabase=MsiGetActiveDatabase(hMsi);

// Put your control name instead of CBO_NAME
sQuery="SELECT * FROM ComboBox WHERE Property='CBO_NAME'";
MsiDatabaseOpenView(hDatabase,sQuery,hCBOView);

// Allocate space to hold the four properties of a combobox row...
hRec=MsiCreateRecord(4);

// Now assign the values
MsiRecordSetString(hRec,1,'CBO_NAME'); // Combobox name. Must be unique with MSI
MsiRecordSetInteger(hRec,2,1); // Position of the line in the combo
MsiRecordSetString(hRec,3,szText); // Key String - a string related to the line
MsiRecordSetString(hRec,4,szText); //  String to be displayed

// Write the updated row
MsiViewModify(hView,MSIMODIFY_INSERT_TEMPORARY,hRec);

// Close handle
MsiCloseHandle(hRec);
MsiViewClose(hView);
end;

Hope this can help.



Hasse

Hasse
  • Members
  • 2 posts

Posted 13 February 2001 - 16:43

Thanks for the help so far!

I'm new to Install Shield / Microsoft Installer so I don't understand how to get all parts to interact.
Where do I put the function that updates the listbox?
Can it be inside a Custom Action?
And if so how do I call a specific function in a Custom Action?