SpiderBear6
Programmer
Does anyone have any experience with the MSI Automation Interface? This is the code that I am trying to get to work...
I have tried to use the view modify code, but ran into an interesting problem. It would actually insert the record but the data would be from a previous insert. I have checked the data that was in the rec record object just before I do the view modify and it is correct so I have no idea where it is getting the old data from. I have no module level variables.
I know this is a long shot, but I have been trying desparately to get this to work. All I want to do is insert a record into a few of the tables of an msi file.
Thanks a bundle.
--------------------------------------
"We are star-stuff. We are the universe made manifest trying to figure itself out."
-- Delenn in Babylon 5 - "A Distant Star"
Code:
Dim rec As WindowsInstaller.Record
rec = m_objInstaller.CreateRecord(7)
With rec
.StringData(1) = sRegistry
.IntegerData(2) = iRoot
.StringData(3) = sKey
.StringData(4) = sName
.StringData(5) = sValue
.StringData(6) = sComponent
End With
Dim vw As WindowsInstaller.View
vw = m_db.OpenView("INSERT INTO 'Registry' ('Registry', 'Root', 'Key', 'Name', 'Value', 'Component_') " _
& "VALUES (?, ?, ?, ?, ?, ?)")
vw.Execute(rec)
vw.Close()
m_db.Commit()
rec = Nothing
vw = Nothing
I have tried to use the view modify code, but ran into an interesting problem. It would actually insert the record but the data would be from a previous insert. I have checked the data that was in the rec record object just before I do the view modify and it is correct so I have no idea where it is getting the old data from. I have no module level variables.
Code:
vw.Modify(WindowsInstaller.MsiViewModify.msiViewModifyAssign, rec)
I know this is a long shot, but I have been trying desparately to get this to work. All I want to do is insert a record into a few of the tables of an msi file.
Thanks a bundle.
--------------------------------------
"We are star-stuff. We are the universe made manifest trying to figure itself out."
-- Delenn in Babylon 5 - "A Distant Star"