Client Management Suite

 View Only

Nested MSIs: Basics and Directions 

Oct 30, 2007 12:38 PM

A nested installation is a type of Custom Action that installs or removes another .msi package (sometimes called the child MSI) from within a running installation (called the parent MSI).

Properties of Nested Installs

  • Nested installations do not display a user interface.
  • A child product generally does not appear in the user's Add/Remove Programs panel, and is not automatically uninstalled when the parent product is uninstalled.

Creating a Nested Installation

Step 1: To create two .MSI files for a nested installation:

  1. Open Wise for Windows Installer, Wise for Visual Studio .NET, or Wise Package Studio. If you are working in Wise Package Studio, open the Windows Installer Editor tool.
  2. Select New from the File menu. The New Installation File dialog appears.
  3. Select the Windows Application icon, then click OK.
  4. Fill in the Product Details page in Installation Expert with information about your installation.
  5. On the Files page in each .WSI, add at least one file to the installation. (Every .MSI needs to have at least one component in the package in order to avoid getting a Windows Installer error).
  6. Save your file with the name Parent.WSI. Compile Parent.WSI into Parent .MSI.
  7. Follow steps 2 through 5 to create another .MSI file and name the next .WSI Child.WSI and compile it into an .MSI.
  8. On the Product Details page, copy the product code listed in the Product Code field to Notepad.
  9. Save this installation file with the name Child.MSI.

Step 2: To create a custom action for the nested installation:

  1. Open the Parent.MSI installation.
  2. Click No in the message to convert the .MSI to a .WSI file.
  3. Click the MSI Script tab, then click the Execute Immediate tab.
  4. Scroll down to the Cost Finalize script line in the Installation Sequence pane. It's the last line in the fifth section of script.
  5. Select the blank line below the Cost Finalize action then double-click the Install MSI from Installation action in the Actions pane. The Install MSI from Installation dialog appears.
  6. Fill in the fields as follows: Custom Action Name: Enter a name for this custom action. Installation to Run: Enter the path to the Child.MSI file. Leave the Property Settings field blank. Click OK.
  7. Double-click the If Statement action in the Actions pane. The If Settings dialog appears.
  8. Enter Not Installed in the If Condition field, then click OK.
  9. Select the blank script line below the new custom action.
  10. Double-click the End Statement action in the Actions pane.

To install all the features of the child installation with their default settings, and to use the same value for the ALLUSERS property used by the parent installation, type the following into the Target field.

ARPSYSTEMCOMPONENT=1 ADDDEFAULT=ALL ALLUSERS=[ALLUSERS]

One can use similar expressions to use the same value of INSTALLDIR in the child as in the parent.

Step 3: To create a custom action for the uninstall:

  1. Scroll down to the REM. Begin the sequence of actions that makes changes to the system script line, which is seven lines below the End statement you added to the script.
  2. Select this script line then double-click the Install MSI from Destination action in the Actions pane. The Install MSI from Destination dialog appears.
  3. Fill in the fields as follows: Custom Action: Enter the name of the custom action. Product Code: Copy and paste the Child.MSI product code from the Notepad file. Property Settings: Enter REMOVE=ALL Click OK.
  4. Double-click the If Statement action in the Actions pane. The If Settings dialog appears.
  5. Enter REMOVE~="ALL" in the If Condition field, then click OK.
  6. In the Installation Sequence pane, select the line below the Install MSI from Destination Product Code that One created.
  7. Double-click the End Statement action in the Actions pane.
  8. Save and compile the Parent.MSI installation.

Media Options for Nested Installations:

  • The child installation must not be compressed inside a Setup.exe installation launcher.
  • If the child installation's files are not compressed inside the child .msi database, we must manually copy the child installation's files to the SourceDir folder of the parent installation.

Removing Nested Installation:

A child MSI is not automatically removed when the parent product is removed. However, one can create a second nested-installation custom action that does this.

Disadvantages of Nested MSIs:

The cons of using the Nested MSI's are,

  • Nested Installations cannot share components.
  • An administrative installation cannot contain a nested installation.
  • Patching and upgrading will not work with nested installations.
  • The installer will not correctly cost a nested installation.
  • Integrated ProgressBars cannot be used with nested installations.
  • Resources that are to be advertised cannot be installed by the nested installation.
  • A package that performs a nested installation of an application should also uninstall the nested application when the parent product is uninstalled.

References:

This above information has been gathered and documented from various sites like Macromedia, MSDN and Altiris.

Hope this congregated article is useful for all...

Cheers' Viju

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Dec 31, 2010 01:17 AM

Will the parent msi have means to check in the registry that the child msi was installed by it or as standalone?

Ideally, it should be right?

Because the installer(.msi) is not dynamic. Its the static information given by the one who created it. So it will some where store that the child msi was already present or if it was installed through parent. SO that uninstallation will uninstall child only if parent uninstalled.

 

Where is that registry information found? Any ideas?

Dec 15, 2009 04:16 AM

Why should this be used under Cost Finalize srciptline only ?

Will this nesting work in Differed execution mode ?

Mar 25, 2009 01:25 AM

Installlation and Un-installation challenges can be effectively solved with using Installer 4.5 or above. We have a new Multi Package Transaction feature being added. Check it for more info.

Mar 19, 2009 07:10 PM

You forgot to mention that another disadvantage of having nested msi's is that you cannot individually uninstall child msi's for upgrading/patching purposes.

Jan 10, 2008 02:56 AM

Step 3 is only for uninstallation of the parent.msi. But if you want to uninstall the child. How do I make a Custom action for this task?

Nov 30, 2007 08:40 AM

The Target field can be anything where you deploy these fields through properties. It can be in a MST or in command prompts too..

Nov 30, 2007 01:40 AM

which target field you are talking abt to enter AllUSERS property?

Nov 02, 2007 11:07 AM

Great Article!

Related Entries and Links

No Related Resource entered.