469,645 Members | 1,424 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

MsiLib

Hi,

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?

Thanks
Charlie

Aug 22 '07 #1
1 3554
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
Aug 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.