I am trying to figure out how to use msilib to extract the registry
information from an MSI file and I really could use a good example of
how that is accomplished or even just an example using msilib in
general. Does anybody happen to know of an example for this as I wasn't
able to find one? If there isn't one, would anybody be willing to throw
one together?
You need to look at the Registry table, whose structure is described here:
http://msdn2.microsoft.com/en-us/library/Aa371168.aspx
In particular, the fields you need to look at are Key, Name,
and Value. Notice that Value is Formatted, so you may have to
expand the formatting first (looking at further tables possibly).
The rough sequence of actions would be
db = msilib.OpenDatabase(path, MSIDBOPEN_READONLY)
view = db.OpenView("SELECT Key, Name, Value FROM Registry")
while True:
record = view.Fetch()
if not record: break
print record.GetString(1), record.GetString(2), record.GetString(3)
Unfortunately, GetString is not implemented yet, so it might be that
what you want to do is not possible yet.
HTH,
Martin