How to extract an MSI file from an EXE installer: A comprehensive guide

Written by Horatiu Vladasel · May 5th, 2023

The MSI Windows Installer is the most popular packaging format used in Enterprise environments. A lot of Independent Software Vendors (ISVs) create their software installer using MSI Windows Installer technology, whether they provide the installer in MSI format directly or wrap it into a setup EXE.

IT professionals find it much easier to work with an MSI installer than a setup EXE. Even when the setup EXE is just a basic wrapper that triggers the MSI installer in the background.

In such cases, you will need to extract the MSI installer from the setup EXE.

In this article, we will guide you through the various options available for extracting an MSI from an EXE.

How to Use 7zip to extract MSI from EXE?

For those MSIs that are wrapped in an archive-like format, such as a compressed file, you can use any archive extractor, such as 7Zip, to extract the MSI file.

To extract an MSI file from an EXE using 7zip follow these steps:

  1. Right-click on the EXE file.
  2. Select "Open with" and choose your archive extractor tool from the list.
  3. Once the EXE file is opened in the archive extractor, locate the MSI file within the contents of the EXE file.
  4. Extract the MSI file by selecting it and choosing the extract option.
Extract an MSI file from an EXE using 7zip

NotePlease note that the location of the MSI within the EXE content may vary depending on the installer and it is not always located directly in the root directory. Also, the MSI file may have a cryptic name such as 132 with no extension.

How to extract an MSI from EXE by copying it from the Temp folder

Some installers extract the MSI file to the Temp folder during the installation process and then remove it from there after the installation is completed.

To get the MSI file from the EXE installer, you need to:

1. Run the EXE installer.

2. When the installation wizard appears, browse to the %temp% folder.

3. Sort the files and folders by modification date.

The MSI file you're looking for should be within the most recent files, sorted by modification date.

Note%temp% could be evaluated differently depending on how you run the command.If it runs from the user context, then %temp% is evaluated to C:\Users\<UserName>\AppData\Local\Temp. Or C:\Windows\Temp, if it runs from system context.

How to extract an MSI from EXE by using Task Manager or Process Monitor

When the MSI installer isn't extracted to the Temp folder, it may instead be located in another directory, such as C:\Program Files\Common Files. In this case, the installer can still run from that location during the installation process.

To identify the location where the MSI file was extracted, you can use either Task Manager or Process Monitor.

To locate the MSI file using Task Manager, follow these steps:

1. Open Task Manager and go to the Details tab.

2. Make sure that the Command line column is enabled.

3. Run the EXE installer.

4. Once you see the installation wizard, go back to the Details tab in Task Manager and look for the msiexec.exe process.

Locate the MSI file using Task Manager

The Command line column should display the full command line, including the path to the MSI installer.

If you use Process Monitor, these are the steps we need to take:

1. Start the capture.

2. Run the EXE installer.

3. When you see the installation wizard, go back to Process Monitor and stop the capture.

4. Go to Tools -> Process Tree and look for msiexec.exe process.

Process Monitor for the msiexec.exe process

This should give you all the details captured by Process Monitor for the msiexec.exe process.

ImportantThe main advantage of this method is that it gives you the location of the MSI file, as well as all the arguments that are parsed to the MSI installer.

Using the setup EXE extract switches

Some setup.exe files offer proprietary extract switches. In general, the switches for installing an application using a setup EXE can vary depending on the tool used to create the installer.The same applies to the switches used to extract the contents of an EXE installer. Let’s take a look at the extract switches for some of the most common tools on the market:

Advanced Installer

Advanced Installer offers a wide option of switches including the msi extract from a setup exe. You can find the full list here.

- Setup.exe /extract <FolderPath> - Extract the content of the setup.exe to the specified location.

- Setupe.exe /a – Performs an administrative installation that copies all the data files to the specified location without creating any shortcut and registering COM.

InstallShield

- Setupe.exe /extract_all:<Folderpath> - Extract the content of the setup.exe to the specified location without running the setup installer.

WiX Toolset

- dark.exe -x <FolderPath> <SetupPath> - Extract binaries from cabinets and embedded binaries to the specified location.

Wise Package Studio

- Setup.exe /x <FolderPath> - Extract the content of setup.exe to the specified location.

Extract MSI from a setup exe made with other application packaging tools

Now, if you can’t tell what is the packaging tool used to create the setup.exe, you can still try to check what parameters the setup supports. Sometimes you can get “lucky” and you might find some extracting options there.

To do that, open a cmd, navigate to the setup exe location, and type the following command

[setupfilename].exe /? or [setupfilename].exe /help

Replace [setupfilename] with your setup.exe name. This should open a pop-up with the available setup, exe options.

Conclusion

Extracting an MSI from an EXE can be a useful technique for IT professionals who prefer to work with MSI installers rather than setup EXEs.

While there is no universal method for extracting an MSI from an EXE, there are several options available, including using an archive extractor like 7zip, locating the MSI in the temp folder, and using Task Manager or Process Monitor to identify the MSI's location during installation.

Additionally, some setup EXE tools have built-in extract switches that allow you to extract the contents of an EXE installer. By trying out these various approaches, you can determine which one works best for your particular EXE installer.

Remember that for the cases when there is no option to extract an MSI from a setup EXE, but you still need the MSI installer, you can always use the Advanced Installer Repackager.

Try it for a 30 days free trial!

We hope you found this tutorial useful.

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: