Create MSI from extracted setup files

installationinstallshieldwindows-installer

I have a folder with a 3rd party installer, the folder contains a setup.exe and all its CAB files next to it (and many related folders).

folder content

I want to be able to re-package this 3rd party installer into something that I can use in my main application installer as a prerequisite (or as a chained msi package).

I want to not just extract/copy those files on the client machine, but run the installer.

Is it possible to create a MSI from all those files using Installshield? I can't seem to find a project type that would do it.

Best Answer

Problem Scenario: What is your scenario?

  • Are you taking over the handling and update of an old setup and need to convert it to a proper format?
  • Are you trying to re-package a third party vendor setup.exe?
  • Are you trying to get hold of the files inside the CABs? Or just to extract the files so they can be re-packaged some other way. For some reason?
  • Are you trying to install the whole shebang as easily and reliably as possibly in silent mode?
  • Some other problem scenario?

Silent Running?: If what you need is to just install silently, then there are command line switches for most setup.exe wrappers that will let you do this, but it is different for every tool used to create the setup.exe file. Installshield's setup.exe files require a silent response file, other tools do it differently. I wrote about Installshield silent uninstall a couple of days ago. And here is a piece on regular silent install and various types of Installshield setup.exe files.

Record response file:

Setup.exe /r /f1”c:\temp\my-answer-file.iss”

Basic silent install:

Setup.exe /s /f1”c:\temp\my-answer-file.iss”

If the setup.exe is a wrapper for an MSI and you have a distribution system to rely on to distribute the pre-requisite components, then it is generally better to extract the MSI if you are in a corporate environment and use the standard features in MSI to run silently (the /QN switch for msiexec.exe):

msiexec.exe /I "C:\Your.msi" /QN /L*V "C:\msilog.log" TRANSFORMS="C:\1031.mst;C:\My.mst"

Quick Parameter Explanation:

/I = run install sequence
/QN = run completely silently
/L*V "C:\msilog.log" = verbose logging
TRANSFORMS="C:\1031.mst;C:\My.mst" = Apply transforms 1031.mst and My.mst (see below).

File Extraction?: Getting the files out of a setup.exe can be challenging, or very easy. It depends what it was built with, and that can be pretty much "anything" - from established deployment tools to proprietary software made by "anyone". To extract files from various types of setup.exe you can find extensive information in this answer:

Essentially you use setup.exe /stage_only for Installshield Suite executables. And setup.exe /a for Basic MSI and Installscript MSI executables. And setup.exe /s /extract_all for legacy Installscript executables. Clarifications below.

MSI Import: If you manage to extract the files and you see an MSI file there, then you should be able to import or open that MSI file in Installshield (or other deployment tools as well).


I'll try a quick "short-list" of extraction options (not sure if that is what you really need):

Already an MSI?: Do you know what that setup.exe contains? Technically it could already be a wrapper containing an MSI file, or it could be the output of some legacy deployment tool and not be a Windows Installer at all. Let's just list a few options:

  1. Administrative Installation: Try to do a setup.exe /a from a command prompt to see if you get an "extract files" dialog. If so, specify an output location and extract all files. This indicates an MSI setup wrapped in a setup.exe
  2. Installscript setup: Try to do a setup.exe /s /extract_all from a command prompt to see if you can extract files from the CABs. This is for Installscript setups. Or try /extract_all:[path] as well.
  3. Installshield Suite Setups: Try to do a setup.exe /stage_only from a command prompt. Lots of elaborate details here.
  4. Advanced Installer: Try to do setup.exe /extract "C:\My work" or setup.exe /x
  5. WiX: Try the following from a command prompt: dark.exe -x outputfolder setup.exe. A WiX setup.exe file can only be extracted using the dark.exe tool from the framework itself. In other words you need to install WiX to extract a WiX setup.exe (as of now).
  6. Wise: Wise is no longer marketed, but many older setups remain. You can try to extract files with setup.exe /X [path].
  7. Repackaging: One way to create an MSI package from older-style, legacy setup.exe installers, is to "capture" the changes done to the system by using an Application Repackaging Tool which monitors changes made to the system whilst a setup.exe is being run.

It is impossible to cover all the different kinds of possible setup.exe files. They might feature all kinds of different command line switches. There are so many possible tools that can be used. (non-MSI,MSI, admin-tools, multi-platform, etc...).

Commmon tools such as Inno Setup seems to make extraction hard (unofficial unpacker, not tried by me, run by virustotal). Whereas NSIS seems to use regular archives that standard archive software can open.

General Tricks: One trick is to launch the setup.exe and look in the 1) system's temp folder for extracted files. Another trick is to use 2) 7-Zip, WinRAR, WinZip or similar archive tools to see if they can read the format. Some claim success by 3) opening the setup.exe in Visual Studio. Not a technique I use.


Some Links:

Related Topic