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

How to dynamically add some item into the List View control?


2 replies to this topic

Joe

Joe
  • Members
  • 3 posts

Posted 05 June 2001 - 12:44

Hi,all...

Now,I'm using ISWI2.03 to create a setup program...

I wanna place a List Box control on the standard ReadyToInstall dialog,what
the purpose is provide an install  summary for the user before start to copy
files,so  the contents in the list box will be the basic install info.
setted by the user,such as the user name,setup type and destination
folder...

Therefore,I must dynamically add the above info. into  the list box  at the
runtime instead of  at the Dialog Editor,
I cannot find any article regarding the topic ,though  I have checked
through the entire help document comes with the ISWI2.03!!

Does anyone can help me out?

Thanks!




Irina

Irina
  • Members
  • 227 posts

Posted 05 June 2001 - 14:39

Hi Joe,
You can use InstallScript code. Write something like that:

function YoursName(hMSI)
NUMBER hDatabase, hView, hRec, nValue;
STRING sQuery, svOption;
begin
hDatabase = MsiGetActiveDatabase(hMSI);

//query ListBox to add items in it
sQuery = "SELECT * FROM ListBox WHERE Property='YOURSLISTBOXPROPERTY'";

MsiDatabaseOpenView(hDatabase, sQuery, hView);

hRec=MsiCreateRecord(4);    
// add new item to ListBox
MsiRecordSetString(hRec, 1, "YOURSLISTBOXPROPERTY'");
MsiRecordSetInteger(hRec, 2, nValue);    
MsiRecordSetString(hRec, 3, svOption);
MsiRecordSetString(hRec, 4, svOption);
MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);

//close view
MsiViewClose(hView);

end


Where nValue is order number (1, 2 ....), svOption is your text. This code add one record to ListBox. If you want to add several record use loop to do that.
So you can add something in the list box on runtime.

Good luck,