Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

.msi file format


5 replies to this topic

Iscander

Iscander
  • Members
  • 2 posts

Posted 31 October 2003 - 15:42

Hi, All!
Can anybody help me: I'm writing archve decomression libraries for antivirus programs. I need description of .msi and InstallShield .cab archive formats. There's a great lack of documentation in Internet on those archive formats. If you can help me (file internal structure, decompression algorithms, may be some sources) - I'll be very thankfull.
Beforehand graceful.
Alex Tarvo.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 November 2003 - 11:16

The MSI file format is documented and there are APIs to access it. MSI is a COM structured storeage.
InstallShield's CAB format (different from Microsoft's) is not documented anywhere. InstallShield include a CAB viewer application (which is not redistributable) with their products. Maybe contact InstallShield directly.

Iscander

Iscander
  • Members
  • 2 posts

Posted 03 November 2003 - 15:59

Thank you for your answer, mr Kruger.
Can you give me link to detailed .msi file format description? My library sould be portable across wide number of systems - all flavours of Unix, Windows, AIX etc. So I can not use Microsoft Windows API to access it. sad.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 November 2003 - 16:32

Please search MSDN for information about the COM Structure Storage file format in general. The MSI database and optionally the CAB files can be stired as streams in such a COM storage.
For information about the database schema and tables in an .msi file consult the MSI SDK documentation:
http://www.msifaq.com/a/1005.htm
I believe that Microsoft's CAB file format is also documented in MSDN.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 05 November 2003 - 19:50

I have read that the MSI file is really an SQL server database. Hence accessing it should be efficiently done using standard SQL.
Regards
-Stein Åsmul

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 05 November 2003 - 21:22

A Windows Installer setups consists of two parts: the installation logic stored in a database, and the application files. The latter may be uncompressed or compressed into CABs. These CABs may be separate, or stored inside the .msi file.

A .msi file is a COM structured storage (similar to MS Office documents) which includes several streams: the installation database, a summary information stream (with information like the product code), and optionally the CABs.

The database is a relational database, but not SQL Server. You can access the contents using a limited SQL syntax, but the tools to run these commands are Windows-only. Also I think Iscander doesn't really want the contents of the database, but the application files (for virus scanning). This may require several steps: 1. Get the CAB file stream from the .msi file and 2. extract the contents of the CAB.

Step 2 should be possible based on Microsoft's CAB documentation. Step 1 could be difficult on non-Windows machines (are there tools to access COM structured storages on Unix?)