By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,698 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,698 IT Pros & Developers. It's quick & easy.

MsiLib

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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.