Extracting MSI files using the commandline

Today I needed to extract a msi file to add a part of it to a solution in visual studio. However installing the software and retrieving the files from the program files directory was not an option. Thankfully I stumbled across a Windows Installer switch today after typing msiexec /? that does the job perfectly: the /a “administrative install” switch, e.g.:

msiexec /a foo.msi /qb TARGETDIR=”C:TEMPFoo”

Then i found someone who had made it into a registry tweak that adds an option when you click the right mouse button on an MSI like seen below:

Copy and paste the following into a *.reg file and double-click it:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareClassesMsi.PackageshellExtract MSIcommand]

@=”msiexec.exe /a “%1″ /qb TARGETDIR=”%1 Extracted””

Leave a comment

Your email address will not be published.