Version 1.0.4  3-10-2004 by Christopher J. Demers

MSI/MSM to InnoSetup and extraction to Access tool.

You can give me feedback ( Christopher J. Demers ) about this tool.  Please include "CJDMSITool" in the subject line to make it easier for my mail filter to separate it from the 10 tons of spam I get every day.

What's New:

1.0.4 - Added support for MSI files with no File table.
1.0.3 - Added support for MSI files with no Registry table.
1.0.2 - Improved Error reporting.
1.0.1 - Added support for MSI files with no SelfReg table.

Disclaimer:

This is Alpha code.  I have not tested it very well. If I waited until I was done to post this code it might never get posted. ;)  Make sure you have working backups and use this code carefully.  Neither I nor any entity with which I may be associated will be responsible for the use or misuse of this code.  Use it at your own risk.

Background:

I wanted an easy way to generate an InnoSetup script based on an MSI merge module (an *.MSM file).  I had to do this manually some months ago.  I have not needed this capability since, so this tool has not really been tested.  However I thought others might find this useful.

I developed the program in Dolphin Smalltalk (developed by Object Arts) because that is the language I use the most at the moment.  It is a powerful pure object oriented environment.  I have included the source code in the zip file at the bottom of this page.

User Description:

The zip file linked at the bottom of this page contains a source code package and an EXE.  The program is a command line utility.  You can run it from the Windows command prompt and pass the required arguments.  If any of the paths include spaces remember to use quotes.  You can run the program with no arguments for help.

Run the program like this to dump the contents of an MSI or MSM database to an MS Access database.  Note that the destination database must be manually created using MS Access before you run the tool, and it should be empty.

    CJDMSITool /dump msiOrMsmFile.msm existingAccessDBFile.mdb

Run the program like this to generate an InnoSetup Script.

    CJDMSITool /inno msiOrMsmFile.msm innoSetupOutputFile.iss

Always make backups of any important files, and carefully evaluate the generated InnoSetup script before running it.

Developer Description:

MSI and MSM files are essentially databases used by the Microsoft Installer.  The first thing I looked for was an OBDC driver that I could use to access the files.  I did not find any.  The MSI SDK includes some ActiveX objects one can use to query an MSI database.  However I did not want my users to have to download the MSI SDK just to run my tool.  I developed an interface to a few functions from the MSI API in msi.dll.  Then I developed some object wrappers ( CJDMSIDatabase, CJDMSIResultSet, and CJDMSIRecord).

Next I wanted to get the MSI database into MS Access so I could have access to additional data analysis tools.  In hindsight this was probably overkill as my queries ended up being very simple due to the limitations of the MSI query engine.  However it was nice to look at the database like a database.  This feature may well be useful for others doing more advanced things.  See the package comment for more information.

Most of the code was done in the wee small hours of the morning as quickly as possible.  Don't use this package as a coding guide. ;)

Limitations

This tool is NOT a magic wand.  I do not have a complete understanding of MSI files (and I am not sure that I want to have one right now).  I did enough research to get my tool to seem to work.  The resulting InnoSetup script will require manual editing.  Also MSI files can run code that may also be important to the setup, none of that will be in the InnoSetup script.  I would be very careful about what MSI/MSM files I use this tool with.  Please be very careful.  In its current state the tool can not extract the binaries from the MSI file.  If there is interest I could add that feature.  Right now if you need to do that use the MSI2XML tool available here
http://msi2xml.sourceforge.net/ , or some other tool.

What it can hopefully do:
Files section (can selfreg DLL's)
Registry section
Some macro expansion

What it can't do:
Conditions
Migrate function calls
Some macro expansion
Extract binary files from the MSI
Much more...

The Point

I am releasing this tool with source code in the hope that it may be of use to someone.  After getting into MSI it became clear to me that there would be quite a bit of work required to develop a  really good MSI to InnoSetup converter.  Even after all that work it is not likely to be perfect.  If enough people can accept the practical limitations of an MSI to InnoSetup converter and still want one and can offer specific suggestions on how to enhance this tool than I may make enhancements.  Keep in mind that this project is going to have to be on a fairly low priority for me, so it may take me a while to make changes.

Download

By downloading this tool you are accepting the disclaimer at the top of this page.  The source code is included.  Feel free to make changes.  But please do not redistribute any part of this tool this without my permission.

Download here -  CJDMSIToolv104.zip

Hit Counter visits since 4-7-2003


See my other Smalltalk tools