Extract files from a MSI package

Usually it is possible to use ones favorite compression utility to treat a Microsoft Installer Package (MSI) like it was a normal archive. Though sometimes it doesn't work, but then one can use the Windows Installer Tool (Msiexec.exe) to extract the files from the MSI package. It can open a MSI package in "Administrator" installation mode, where it can extract the files without performing the install.

Runs setup where one can select where to extract the files without actually installing the application:

Msiexec /a mypackage.msi

Extracts the files to the specified location without user interaction:

msiexec /a mypackage.msi /qb TARGETDIR="C:\MyFolder"

Note this can also be useful in case an MSI package has been configured to block install, when used on certain versions of Microsoft Windows.

More Info MS KB227091

Updated: 16 October 2008

Comments:

  1. Phil says:

    Also, if you have an exe file that is a self executing MSI file, run the file, then look for a new folder in the c: root with a strange name - that's the extracted files - make a copy of them and cancel the install. That way to achieve the same as above.

  2. Phlowzing says:

    Thanks for the nice tip. If WGET is on the box, I could create myself a little on-liner example to aquire and unpack a full featured setup package like the windows server 2003 resource kit tools (as an example):

    wget -nv http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe&mkdir setup-depack&echo rktools /C /T:"%~d0%~p0setup-depack">depack.cmd&depack.cmd&mkdir msi-depack&echo msiexec /a setup-depack\rktools.msi /qb TARGETDIR="%~d0%~p0msi-depack">depack.cmd&depack.cmd&del depack.cmd

    That will unpack the actual setup.exe into setup-depack and the setup.msi into msi-depack below the current directory.

Leave a Reply

Your email address will not be published. Required fields are marked *