Hi mallen
here's a kind of code snippet i played around with some time ago. I didn't manage to get it run corrctly, but i didn't knew that i have to have a dialog twin to update the controls....
Anyway it's a VB Script CA code... you have to write your list values into the specific MSI table, and i suppose afterwards switch to the dialog twin... the step that i missed obviously when i tried that stuff.
The code might not be correct in each line, but i guess it will give you an idea of what you need to do.
Cheers
Stefan
CODE |
Public Function AppendListBox () Dim oDatabase Dim oView Dim oInstaller
Dim oRecord Dim intCount Dim oRecordErr
On Error Resume Next
Set oDatabase = Session.Database
Set oView = oDatabase.OpenView("SELECT * FROM ListBox")
If oView Is Nothing Then Set oDatabase = Nothing Exit Function End If
Set oInstaller = Session.Installer
'Each record will have four columns. First is the property, second an id 'third to the value and the fourth to the key Set oRecord = oInstaller.CreateRecord(4)
If Not oRecord Is Nothing Then 'Set the property of the control to which the records are to be attached oRecord.StringData(1) = "MYPROPERTY" oRecord.IntegerData(2) = id '(integer) oRecord.StringData(3) = "value" oRecord.StringData(4) = "key" End If
On Error Resume Next 'Read/Write on to the view oView.Modify 7,oRecord
Set oRecord = Nothing
Set oRecordErr = oInstaller.LastErrorRecord
If Not oRecordErr Is Nothing Then For intCount = 0 to oRecordErr.FieldCount ShowError oRecordErr.StringData & " " & oRecordErr.IntegerData Set oRecordErr = Nothing Exit Function Next End If
oView.Close Set oView = Nothing Set oDatabase = Nothing Set oInstaller = Nothing Set oRecord = Nothing Set oRecordErr = Nothing
End Function
|