MsiLib

C

Charlie

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top