views:

384

answers:

1

All I want is a command-line tool that can extract files from a merge module (.msm) onto disk. Said differently, I want the same "administrative install" functionality that is possible for an MSI:

msiexec /a myProduct.msi TARGETDIR="C:\myInstallation" /qn

The above only works on an msi (near as I can tell). So to get the same effect for a merge module, I'm trying msidb.exe and orca.exe The documentation for orca states:

Many merge module options can be specified from the command line...

Extracting Files from a Merge Module

Orca supports three different methods for extracting files contained in a merge module. Orca can extract the individual CAB file, extract the files into a module tree and extract the files into a source image once it has been merged into a target database...

Extracting Files

To extract the individual files from a merge module, use the

... -x ... option on the command line, where is the desired path to the new directory tree.

The specified path is used as the root path for the extracted files. All files are extracted from the CAB file embedded in the module and placed in the specified path. The directory layout for the extracted files is based on the directory tree of the merge module.

It sounds like what I need. But when I try it, orca simply opens up an editor (with info on the msm I specified) and then does nothing. I've tried a variety of command lines, usually starting with this:

orca -x theDirectory theModule.msm

I use "theDirectory" as whatever empty folder I want. Like I said - it didn't do anything.

Then I tried msidb, where a couple of attempts I've made look like this:

msidb -d theModule.msm -w {storage}

msidb -d theModule.msm -x MergeModule.CABinet

In the first case, I don't know what to put for {storage}. In the second case, it turns out that the literal string "MergeModule.CABinet" is necessary (it is a reserved name). However, the extracted cabinet does not preserve the file hierarchy or "normal" file names; so I can't use it for my purposes.

Can someone explain what I'm doing wrong with the command line options? Is there any other tool that can do this?

A: 

MSI2XML

Kyle Alons
On your suggestion, I used it: "msi2xml -b streams -c files installation.msi" ...and it had basically the same result as doing: "msidb -d theModule.msm -x MergeModule.CABinet" and "expand MergeModule.CABinet" So I'm still stuck. If only the "administrative install" of msiexec.exe would work on an msm file. That is basically the "file extraction" behavior I'm looking for.
Brent Arias