InstallerContactSite Map

Below is a description of the Windows Installer custom actions used in Advanced Installer.

  1. Attached Custom Action
  2. Installed Custom Action
  3. Script Inline
  4. Error Message
  5. Property Source
  6. EXE with Working Dir
  7. Property Set with Formatted
  8. Directory Set with Formatted
  9. MSI Database Relative to Package
  10. MSI Database with Product Code

Attached Custom Action

Using this type of custom action you can execute an application (EXE or DLL) or run a script (VB or Java script) which is not among your project files. This usually happens when this functionality is only useful in the installation process, but not for the installed application itself.

This source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Description of the fields:

  • Source Path - the path to the custom action file. You can use the [ ... ] button to change the custom action's file.
  • Source Type - contains the type of the custom action file. By default, this type is set depending on the extension of the file. You can change this type if you know for sure that the extension of the file doesn't reflect the type of its content. This only works for attached custom actions.
  • Function Name / Command Line / Properties - represents:
    • The name of a function (if the custom action is of DLL, JavaScript or VBScript type). In the case of a DLL the list will be automatically populated with the names of the functions included in it.
    • The command line arguments (in the case of a custom action of EXE type). In this case, the command line arguments are actually of Formatted Type and thus they can include references to files, folders and properties. Use the [ Edit ] button to include references to a file, a folder or a property.
    • Properties (in the case of a MSI installation) representing settings for the installation process. Usually they will specify some features that are to be installed. Note that it is not recommended to attach a MSI package to an installation.

Installed Custom Action

This custom action is an application (EXE or DLL) or a script (VB or Java script) included in the MSI package. It behaves as an attached custom action ,but it must be scheduled after the files have been deployed on the target computer.

Description of the fields:

The usage of the fields is identical to the one described for the Attached Custom Actions.

Script Inline

This custom action is basically a small VBScript or JScript that is ran during the install process.

Description of the fields:

  • Source Type - select the type of the script from the drop-down list.
  • Script Text - edit this field with the body of the script. This is a plain text field, so you can't add references to files, folders or properties.

Usually this script is made up of a single line. If it is longer and needs to be placed on several lines just edit the "Script Text" field with the body of the script and use the ":" character (without the quotes) to mark the place where a line ends and another begins.

A custom action that is written in JScript or VBScript requires the install Session object. The installer attaches the Session Object to the script with the name "Session". Because the Session object may not exist during an installation rollback, a deferred custom action written in script does not have access to all the methods and properties of the Session object.

Here is an example of a "Script Inline" custom action written in VBScript:

MsgBox Session.Property("APPDIR")

This custom action will prompt a message box containing the value of the APPDIR property.

Error Message

This custom action enables the stopping of the installation process if some condition is satisfied or not. An error message will be displayed to let the user know what has happened.

The condition for stopping the install process must be entered in the "Execution Condition" field.

Description of the fields

Error message - the message that will be displayed to the user. It is of Formatted Type so you can use the [ Edit ] button to insert reference to files, folders and properties.

Property Source

This custom action calls an executable or a script launched with a command line. The path to the executable file is specified through a property.

Description of the fields:

  • Property Name - the name of the property that contains the path to the executable file. The name of the property is not placed between brackets ( ] ).
  • Source Type - select the type of the executable file from the drop-down list.
  • Command Line - edit this field with the command line options for the executable file. This field is of Formatted Type so you can use the [ Edit ... ] button to insert reference to files, folders and properties.

EXE with Working Dir

This custom action calls an executable file. This file has a designated folder as Working Directory.

When creating a "Exe With Working Dir" type of custom action you will be prompted with a window that will allow you to choose the working directory for the executable file.

Description of the fields:

  • Working Dir - the working directory for the executable file. Use the [ ... ] to change it.
  • Full Path - the full path to the executable file. Quotation marks must be used around long file names or paths. This field is of Formatted Type. Use the [ Edit ... ] button to insert a reference to file, folder or property.

Property Set with Formatted

This custom action sets a property from a formatted text string.

Description of the fields:

  • Property Name - the name of the property to be formated. The name of the property is not placed between brackets ( ] ).
  • Formatted Text - the formatted string. This field is of Formatted Type so you can use the [ Edit ... ] button to insert reference to files, folders and properties.

NoteTo affect a property used in a condition on a component or feature, the custom action must come before the CostFinalize action in the action sequence.

Directory Set with Formatted

This custom action enables setting a folder from a formatted text string.

Description of the fields

  • Directory - the folder who's path is to be modified. Use the [ ... ] button to change it.
  • Formatted text - the text which forms the path for the folder. This is of Formatted Type. Use the [ Edit ] button to insert a reference to file, folder or property.

ImportantThe formatted text must be expanded into a valid absolute path, in order for the custom action to work.

Example:

  • "[WindowsVolume][USERNAME]" is a valid string as it will be expanded into "C:\Fred\" (when the windows volume is c: and the user is Fred).
  • "[USERNAME]\SubFolder" is a bad string as it will be expanded into a relative path: "Fred\SubFolder".

NoteThis custom action can be scheduled only after the CostFinalize action.

MSI Database Relative to Package

This custom action installs a MSI file. This operation is also called a nested installation. The location of the MSI file must be relative to the location of the main MSI (in the same folder or one of it's subfolders).

Example:

Your package is named Main.msi and is located in "c:\packages\test" and your nested install package is named Nested.msi. The Nested.msi can be located:

  • in the same folder - "c:\packages\test"
  • in a subfolder of this folder - "c:\packages\test\subfolder\nested.msi"

Description of the fields

  • Source Path - the location of the MSI file
  • Properties - properties representing settings for the installation process. Usually they will specify some features that are to be installed.

ImportantThis type of custom action has been deprecated and it is not recommended to use it. If your package requires another application to be installed you can use Software Prerequisites or Merge Modules (for creating a part of the installation package).

MSI Database with Product Code

This custom action is used to modify or remove a product installed by the current package. It may also be used to install a product that has been previously installed as advertised. The MSI is identified by it's product code.

Since this type of custom action is usually used for uninstalling a product previously installed by the current package, Advanced Installer will automatically add a custom action for this purpose every time you add a nested installation.

NoteYou cannot use this type of custom action for products previously installed by any other means.

Description of the fields

  • Product Code - the product code of the MSI. You may enter it directly or you can use the [ ... ] to select the MSI and let Advanced Installer to automatically extract it.
  • Properties - properties representing settings for the installation process. For example, to remove a product set the REMOVE property to the value ALL (REMOVE=ALL).

ImportantThis type of custom action has been deprecated and it is not recommended to use it.