Install Actions

You can use the install actions to run commands before and after the wrapped executable is run. These actions can be any command line, you wish to run. This includes batch files and other scripts with or without parameters.

If you combine this feature with the ability to include other files than the wrapped executable itself, then you can do a wide variety of things. These are some examples:

Add Entries to the Registry

Use regedit.exe and a registry file to modify the registry database. You can read about the command line for the Registration Info Editor at Microsoft's website.

Run a VB Script

You can launch a VB Script using the cscript.exe or wscript.exe command line syntax. With these scripts you can do virtually anything including accessing databases, files, and folders.

Run Powershell

Just like the VB script mentioned above, you can do a lot with access to run Powershell scripts.

Current Directory

When actions are run, the current directory is the folder where the files were unpacked to.

See Also

Wizard Page - Actions

Include Files in MSI

When you wrap and executable installer in an MSI package, the executable is compressed and stored inside the MSI. At the time of installation, the wrapped file is unpacked to a temporary directory and run from there.

It is also possible to include other files with the MSI package. The MSI Wrapper can optionally include all the files and folders in the same directory as the executable. If this option is used, all the files are unpacked to the temporary location.

This feature is useful if your wrapped installer requires other files during the installation. You can also use it to include additional resources such as registry files or batch files, which should be run during the installation.

Please note that the temporary directory where the files and folders are unpacked to is removed when the installation is done. Therefore, any files that you want to keep should be copied to another location.

MST Transformation Files

MST files are used to transform the content of an MSI package. They are often used by administrators to customize the behavior of an existing MSI file. They use the MST files together with the original MSI package in their software distribution systems such as group policies.

You can also use MST files with wrapped executable installers. A common scenario is that you want to pass command line parameters to the wrapped installer. In order to do that you can create an MST file that adds the WRAPPED_ARGUMENTS property to the property table.

Tools such as Orca can be used to generate a MST file. The image below shows how you can add this property and insert extra command line arguments for the wrapped installer. In this example, we add a logging parameter for our test program built with Inno Setup.

After the MST is saved, we can test it from the command line.

msiexec /i setup_1.0.msi TRANSFORMS=mylog.mst

Remember to have your command line running as administrator if you want to run it silently with a /q. Otherwise, the elevation will most likely fail.

Exit Codes

The wrapped installers often return different exit codes. Exit codes typically say if the installation was a success or a failure.

When the MSI Wrapper looks at the exit code from the wrapped installer, it expects 0 (zero) to mean success and everything else a failure. However, sometimes the wrapped installer have multiple exit codes for success under different circumstances. It also happens that the exit code tells that the system needs to be rebooted before the installation is completed.

Starting with version 7 of the MSI Wrapper, you can map exit codes from the wrapped installer to different behavior in the MSI package. You can specify which exit codes represent a success and what which codes represent a pending reboot of the computer. This map is specified in the advanced settings.

The map is a comma-separated list of success exit codes or a map to code 3010, which signals a pending reboot.



This means that the exit codes 0 and 2 from the wrapped installer is a success. Exit code 11 signals a reboot.


Reboot exit codes vary between executable installers. It sometimes depends on the installer framework used to create the executable installer. In case your installer is built with the Inno Setup framework, it most likely supports the command line switches /NORESTART /RESTARTEXITCODE. When you use the MSI Wrapper it is recommended that you use the /NORESTART to prevent the wrapped installer to initiate the restart of the system. Instead you can wrap it with the switches /NORESTART and /RESTARTEXITCODE=1234. Then you can map the exit codes with 0,1234=3010 to make the MSI package detect the need to restart and pass that information on to the program that installs the MSI package.