Click here to Skip to main content
12,998,394 members (70,864 online)
Click here to Skip to main content
Add your own
alternative version


23 bookmarked
Posted 4 Mar 2009

Invoke another MSI from an MSI

, 4 Mar 2009
Rate this:
Please Sign up or sign in to vote.
Demo showing how to invoke a Microsoft Windows Installer wrapped in a Microsoft Windows Installer.


I was looking for a way to solve the problem of Windows’ concurrent (nested) installations as described in the URL: My goal is to wrap an MSI based InstallShield EXE or MSI within the Visual Studio Windows Installer Project. I was able to find some useful tips online, and I have converged the information and found a solution described below. I also found Arnaldo Sandoval's "Installer Class and Custom Actions" article very helpful (URL:

How it works

I created two projects in the solution:

  • InstallerHelper – A console application project with C# code to enable code based custom actions.
  • MsiInstaller – A Windows installer project that creates the MSI.

First, for the InstallerHelper project, I created two simple classes:

  • InstallerClass - This installer class overrides the base installer class to provide additional functionality for Custom Actions.
  • InstallerHelper - This helper class is used to invoke the MSI based InstallShield EXE or MSI.

In general, the InstallerClass class calls the InstallerHelper class to invoke the MSI based InstallShield EXE or MSI. Here is what I have achieved in my MSI installer demo:


Next, for the MsiInstaller project, I added to the File System both the output from the InstallerHelper project, and the MSI based InstallShield EXE or MSI to be installed on the target machine. I found that you can actually drag and drop multiple dependency files and folders to the File System view.


I added the primary output InstallerHelper as the Custom Actions for all.


This achieves the goal of invoking an MSI within a Visual Studio Windows Installer Project. When I run the MSI, it will first install the MSI based InstallShield EXE or MSI, but not executing it. Then, it runs the InstallerHelper which kicks-off the EXE or MSI.


A tip I found is that if the imported MSI based InstallShield EXE or MSI already contains Custom Actions, which is very common, then when you add the EXE or MSI to the Visual Studio Windows Installer Project, the Custom Actions is carried over to the Windows Installer Project. This gives the undesirable result of concurrent installation because some of the Custom Actions from the embedded MSI are invoked while the wrapper MSI is running. A simple solution is to use Orca.exe, select the CustomAction, and delete the ones that are being imported form the embedded EXE or MSI install process.


  • Feb 2009 - first release.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

A. Kwan
Systems Engineer
Canada Canada
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionYour solution is still helping us after 8 years... Pin
sumu_bade28-Apr-17 6:57
membersumu_bade28-Apr-17 6:57 
QuestionMsiInstaller folder has only one file viz.MsiInstaller.vdproj Pin
RCBGouda22-May-15 12:03
memberRCBGouda22-May-15 12:03 
Tarmo Pikaro18-Oct-13 11:30
memberTarmo Pikaro18-Oct-13 11:30 
QuestionThank You Pin
IamPhani29-May-13 1:51
memberIamPhani29-May-13 1:51 
SuggestionIf the main objective is just to call a second *.msi than... Pin
netxsk11-Jan-13 3:37
membernetxsk11-Jan-13 3:37 
GeneralRe: If the main objective is just to call a second *.msi than... Pin
Member 961819220-Mar-13 2:03
memberMember 961819220-Mar-13 2:03 
GeneralRe: If the main objective is just to call a second *.msi than... Pin
netxsk26-Apr-13 2:43
membernetxsk26-Apr-13 2:43 
SuggestionYou can also do to the same thing by using Visual Studio Custom Prerequisites Pin
kensurferca13-Dec-11 14:07
memberkensurferca13-Dec-11 14:07 
GeneralUsing predefined installation path in nested installer Pin
tonyt2-Dec-09 5:52
membertonyt2-Dec-09 5:52 
GeneralRe: Using predefined installation path in nested installer Pin
netxsk11-Jan-13 3:17
membernetxsk11-Jan-13 3:17 
In some cases like (Pervasive.msi) you have a "ptksetup.ini" associated.
In that *.ini you'll find something like this:
; *** Destination Folder *** Custom Setup Only ***
; *** Destination folder ***
;    KEY: sets the Destination Folder dialog display
; VALUES: 0 = displays the Destination Folder dialog
;         1 = hides the Destination Folder dialog and uses default destination paths
;             unless paths specified by the Directory Locations keys described below
; *** Directory Locations ***
; *** Application data files ***
;   KEY: target directory for installing PSQL data (user modifiable) files
; VALUE: the fully qualified path for installing  PSQL data files
; MAXIMUM LENGTH: 204 characters
;  NOTE: DO NOT enter a path length greater than the MAXIMUM LENGTH specified above.
PVSW_PSQL_DATADIR=[CommonAppDataFolder]Pervasive Software\PSQL\

In this *.ini that some installers have you can set the path to where your second *.msi will install.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 4 Mar 2009
Article Copyright 2009 by A. Kwan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid