What is Nested installation?
- A nested installation action installs another Windows Installer package during a currently running installation.
- A nested installation action can only reinstall or remove an application that has been installed by the current application's installation package.
- The type of nested installation action is specified in the Type field of the CustomAction table. Depending upon the custom action type, the package for the nested application can reside in a substorage of the main package, as a file at a location specified by a property, or as an advertised application on the user's machine.The following types of custom actions perform a nested installation.
Nested installation of a product residing in the installation package.
Custom Action Type 23
Nested installation of an installer package within the current source tree.
Custom Action Type 39
Nested installation of an advertised installer package.
- A nested installation shares the same user interface and logging settings as the main installation.
- Nested installation actions should be placed between the InstallInitialize action and InstallFinalize action of the main installation's action sequence.
- Standard or custom actions that specify an automatic restart of the system, or request the user to restart, can also perform restart or request from within a nested installation.
- A nested installation action can install an application to be run locally, to run from source, to be reinstalled, or to be removed .To specify this type of installation, pass either the ADDLOCAL, ADDSOURCE, REINSTALL, or REMOVE property to the nested installation action.
- Nested installation actions can be authored in pairs, one action used for installing and the other action used for removing the nested installation. A Custom Action Type 7 or Custom Action Type 23 is typically used to install. A Custom Action Type 39 is typically used to remove the nested installation when the parent product is uninstalled. The record for the removal custom action in the CustomAction table can have the product code GUID in the Source field and "REMOVE=ALL" in the Target field.
- 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.
Step 1: To create two MSI files for a nested installation:
- Open Wise Package Studio, open the Windows Installer Editor tool.
- Select New from the File menu. The New Installation File dialog appears.
- Select the Windows Application icon, then click OK.
- On the Files page in each .WSI, add at least one file to the installation.
- Save your file with the name Parent.WSI. Compile Parent.WSI into Parent .MSI.
- Follow steps 2 through 5 to create another .MSI file and name the next .WSI Child.WSI and compile it into an Child.MSI.
- Save this installation file with the name Child.MSI.
- Open the Parent.MSI installation.
- Click the MSI Script tab, then click the Execute Immediate tab.
- Scroll down to the Cost Finalize script line in the Installation Sequence pane.
- Select the blank line below the Cost Finalize action then double-click the Install MSI from Installation or Install MSI from Relative path action in the Actions pane. The required dialog appears dialog appears.
- Fill in the fields as follows:
Installation to Run: Enter the path to the Child.MSI file.
Leave the Property Settings field blank.
6. Double-click the If Statement action in the Actions pane. The If Settings dialog appears.
7. Enter Not Installed in the If Condition field, then click OK.
8. Select the blank script line below the new custom action.
9. Double-click the End Statement action in the Actions pane.
- 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.
- Select this script line then double-click the Install MSI from Destination action in the Actions pane. The Install MSI from Destination dialog appears.
- Fill in the fields as follows:
Product Code: Copy and paste the Child.MSI product code.
Property Settings: Enter REMOVE~=ALL
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.
- 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.