I want to extract the MSI of an EXE setup to publish over a network.
For example, using Universal Extractor, but it doesn\'t work for Java Runtime Environment.
7-Zip should do the trick.
With it, you can extract all the files inside the EXE (thus, also an MSI file).
Although you can do it with 7-Zip, the better way is the administrative installation as pointed out by Stein Åsmul.
I'm guessing this question was mainly about InstallShield given the tags, but in case anyone comes here with the same problem for WiX-based packages (and possibly others), just call the installer with /extract, like so:
C:\> installer.exe /extract
That'll place the MSI in the folder alongside the installer.
For InstallShield MSI based projects I have found the following to work:
setup.exe /s /x /b"C:\FolderInWhichMSIWillBeExtracted" /v"/qn"
This command will lead to an extracted MSI in a directory you can freely specify and a silently failed uninstall of the product.
The command line basically tells the setup.exe to attempt to uninstall the product (/x) and do so silently (/s). While doing that it should extract the MSI to a specific location (/b).
The /v command passes arguments to Windows Installer, in this case the /qn argument. The /qn argument disables any GUI output of the installer.
Launch the installer, but don't press the Install > button. Then
cd "%AppData%\..\LocalLow\Sun\Java"
and find your MSI file in one of sub-directories (e.g., jre1.7.0_25
).
Note that Data1.cab
from that sub-directory will be required as well.
The only way to do that is running the exe and collect the MSI. The thing you must take care of is that if you are tranforming the MSI using MST they might get lost.
I use this batch commandline:
SET TMP=c:\msipath
MD "%TMP%"
SET TEMP=%TMP%
start /d "c:\install" install.exe /L1033
PING 1.1.1.1 -n 1 -w 10000 >NUL
for /R "%TMP%" %%f in (*.msi) do copy "%%f" "%TMP%"
taskkill /F /IM msiexec.exe /T
There is no need to use any tool !! We can follow the simple way.
I do not know which tool built your self-extracting Setup program and so, I will have to provide a general response.
Most programs of this nature extract the package file (.msi) into the TEMP directory. This behavior is the default behavior of InstallShield Developer.
Without additional information, I would recommend that you simply launch the setup and once the first MSI dialog is displayed, you can examine your TEMP directory for a newly created sub-directory or MSI file. Before cancelling/stopping an installer just copy that MSI file from TEMP folder. After that you can cancel the installation.