Custom Actions List

This article describes properties that are particular to each predefined custom action available in Advanced Installer. Generic properties are explained in Custom Action Properties.

  1. Launch attached file
  2. Launch installed file
  3. Launch file
  4. Open URL
  5. Launch file from property
  6. Launch EXE with working directory
  7. .NET Installer Class action
  8. Set installer property
  9. Set directory path
  10. Call function from attached native DLL
  11. Call function from installed native DLL
  12. Call function from standard DLL
  13. Call Method from .NET Assembly
  14. Execute inline script code
  15. Run Inline PowerShell Script
  16. Run PowerShell Script From File
  17. Generate and install a self signed certificate
  18. Display error message
  19. Display message box
  20. Close application
  21. Detect process
  22. Terminate process
  23. Detect service
  24. Stop service
  25. Start service
  26. Configure non admin service start
  27. Check if user exists
  28. Query SQL database for data
  29. Test ODBC connection
  30. Send install information to your web server
  31. Browse for file
  32. Copy file/folder
  33. Predefined custom actions for working with ComboBox controls
  34. Predefined custom actions for working with List Box, List View and Check List controls
  35. Update MSI edit controls
  36. Set user interface Property from execute sequence
  37. Resolve known folder path
  38. Start image slideshow
  39. Stop image slideshow
  40. Check TCP port
  41. Get a free TCP port
  42. Preserve Install Type of the old version
  43. Uninstall previous versions
  44. Add network location
  45. Remove network location
  46. Get free disk space
  47. Play audio file
  48. Install MSI relative to package
  49. Configure MSI with specific Product Code
  50. Collect features without CAB
  51. Disable Features
  52. Update Features Install States
  53. Process Data
  54. Install MSIX package
  55. Uninstall MSIX package
  56. Install certificate
  57. Uninstall certificate
  58. Resolve Formatted Property

Launch attached file

Using this type of custom action you can execute an application (EXE or DLL) or run a script (VB or Javascript) 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.

Properties

  • Attached File - the path to the custom action file. You can use the [ ... ] button to change the custom action's file.
  • File 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 / 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 an 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 an MSI package to an installation.
  • Action Data - represents the value of the CustomActionData property. This property can be retrieved as a regular property inside Deferred custom actions and it is available only for DLL, JScript and VBScript custom actions. A common usage scenario is to use the CustomActionData property in Rollback Custom Actions since they are also deferred.

NoteDeferred custom actions can receive information about the installation process, mostly only embedded in the CustomActionData property. However, this type of custom actions do not have access to installer properties.

Launch installed file

This custom action is an application (EXE or DLL) or a script (VB or Javascript) 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.

Properties

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

Launch file

This is a predefined attached custom action. It allows the launching of a file into execution or opening of a folder (the same action that occurs when you double-click it in Explorer).

Properties

  • File To Launch - field should contain the full path of the file you want to launch. This field is of Formatted Type and thus it can include references to files, folders, and properties. For example, if the file is called "MyBatchFile.bat" and it is added as a regular file, then you can add a reference to it in the "File to launch" field like this:
[#MyBatchFile.bat]

For a temporary file, the "File to launch" field would look like this:

[&MyBatchFile.bat]
  • Command Line - you can specify command line parameters that will be passed to the target file.
  • Working Directory - set a custom working directory for the target file.
  • Hide program's window - the main window or console of the launched program will not be visible.
  • Run As Administrator - launch the target file as an Administrator (the equivalent of Run As... or Run As Administrator Windows Shell options). When setting this option through a button control, you should set the Elevation Shield control property to True. This will make the OS (Vista, and above) show an elevation shield on the button when the installation runs, to warn the installing user that an elevation request is about to happen when the button is pressed.
  • Use 64-bit Launcher - the file is launched using a 64-bit process.

ImportantIf the package is running with Administrator privileges, the Launch File custom action does not inherit the elevated privileges from the package. If you need to run your custom action with elevated privileges, you need to check "Run as Administrator" option for the custom action in question.

Open URL

This custom action uses the supplied URL to open a page in the default browser on the target computer.

Launch file from property

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.

Properties

  • Property - the name of the property that contains the path to the executable file. The name of the property is not placed between brackets ( ] ).
  • File 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.

Launch EXE with working directory

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

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

Properties

  • File 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.
  • Command Line - specify the command line parameters which will be passed to the EXE file.
  • Working Directory - the working directory for the executable file. Use the [ ... ] to change it.

.NET Installer Class action

This is a custom action that launches a .NET Assembly. The assembly must have a class that inherits the Installer class with the RunInstaller attribute set to true.

Assembly Target Platform

Custom actions are created and conditioned depending on your assembly target platform:

  • x86 - A single custom action will be created to run on any platform.
  • x64 - A single custom action will be created to run only on 64-bit platforms.
  • Any CPU - Two custom actions will be created and conditioned (one to run on 32-bit platforms and the other for 64-bit platforms)

You can also modify the execution conditions as desired.

Assembly

  • Dll Path - Represent the assembly that will be launched with the parameters specified below. It must have a class that inherits from the Installer classes and the RunInstaller attribute set to true.
  • Configure file path - This path represents the location where the .NetCustActLauncher will create the assembly's configuration file. The configuration file contains the .NetFramework required version. This field is of Formatted Type and can be edited using Smart Edit Control.

Installer Class Parameters

The assembly custom action requires some predefined parameters. In addition, you can add new parameters in order to pass information to your .NET custom action.

You can add or edit parameters using the .NET Installer Class Argument Dialog.

Predefined parameters:

  • Action - specifies the Installer class method that will be called. It can have one of the following values: "Install", "Rollback", "Commit", "Uninstall". If you move the custom action under another standard action you may want also to change the Action parameter.

NoteWhen you create a custom action for Install, Uninstall, Rollback or Commit you must also change the Action parameter to the correspondent method.

  • InstallType.
  • LogFile - specifies the name of the log file where install progress is recorded. If empty then no log will be created.
  • ReqVersion - specifies the version of the .NET Framework required by the assembly. Advanced Installer automatically determines the required version, but you can overwrite that value.

NoteYou can't remove predefined parameters.

Debug the method of the .NET Installer Class Action

A quick way to Debug the .Net Installer Custom Action can be found here.

Set installer property

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

Properties

  • Property - the name of the property to be formated. The name of the property is not placed between brackets ( ] ).
  • Value - 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 "Paths Resolution" action group from "Install Execution Stage".

Set directory path

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

Properties

  • Directory - the folder who's path is to be modified. Use the [ ... ] button to change it.
  • Value - 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 "Paths Resolution" action group from "Install Execution Stage".

Call function from attached native DLL

Using this type of custom action you can call a function from a native DLL. You can find a sample DLL and its project in the Serial Number Validation DLL article.

The target DLL will be embedded in the MSI file but will not be deployed at install time with the other application files. This action has the same options as the Launch attached file custom action.

Call function from installed native DLL

Using this type of custom action you can call a function from a native DLL. You can find a sample DLL and its project in the Serial Number Validation DLL article.

The target DLL must be installed by your package and must exist on disk when this custom action is executed. This action has the same options as the Launch attached file custom action.

Call function from standard DLL

This predefined custom action can be used to call a function from a dll file. Unlike native dll custom action where the called function must have a predefined signature, this custom action allows you to call a function with any signature.

ImportantThe dll file from which the function is called must be included in the application files. You can do this in the Files and Folders Page - Installer Project by either adding it as a regular file or as a temporary file.

DLL

  • Path - specifies a formatted string that resolves to an absolute path of a DLL.
  • 64-bit - this option configures the custom action to call a function from a 64-bit DLL file.

Function

  • Return Type - specifies the type of value returned by the function.
  • Return Property - the name of the property where will be stored the result returned by the function - if function type is other than void.
  • Calling Convention - the calling convention to use when the function will be called.
  • Name - the name of the function from DLL to be called.

Arguments

The list with the function's arguments. There can be any number of arguments.

Tip You can change the order of arguments using the [ Move Up ] and [ Move Down ] context menu options.

Call Method from .NET Assembly

This predefined custom action can be used to call .NET Core and .NET Framework code.

ImportantIn order for the custom action to execute the code, the appropriate version of .NET Core or .NET Framework should be installed on the target machine, so it should be added as a prerequisite to your project.

For more information please see How to create a .NET Custom Action article.

Properties

Assembly

Specify the .NET Assembly location. This field is of Formatted Type

Method

Specify the method to be called. This field is of Formatted Type

Action Data

Action Data - represents the value of the CustomActionData property. This property can be retrieved as a regular property inside Deferred custom actions. A common usage scenario is to use the CustomActionData property in Rollback Custom Actions, since they are also deferred. This field is of Formatted Type

64-bit

This option configures the custom action to call 64-bit code.

Code example

          {
  public class MyCustomActionsClass
  {
    public static int MyFunctionName(string MyCustomActionData)
    {
    }
  }
        

Execute inline script code

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

Properties

  • 64-bit script - specify whether this is a 64-bit script.
  • Action Data - represents the value of the CustomActionData property. This property can be retrieved as a regular property inside Deferred custom actions and it is available only for DLL, JScript and VBScript custom actions. A common usage scenario is to use the CustomActionData property in Rollback Custom Actions, since they are also deferred.

NoteDeferred custom actions can receive information about the installation process, mostly only embedded in the CustomActionData property. However, this type of custom actions do not have access to installer properties.

  • Script 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.

A custom action which 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 "Execute inline script code" custom action written in VBScript:

MsgBox Session.Property("APPDIR")

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

ImportantAny return value of the script functions is interpreted as success by this custom action type.

Important"Wait for custom action to finish before proceeding" option from "Execution Options" field is mandatory for script custom actions and cannot be disabled.

Run Inline PowerShell Script

This custom action is basically a small inline PowerShell script that is ran during the install process.

ImportantBuilt-in Windows PowerShell is the default tool used to run the script.

At install-time the custom action will select which PowerShell tool to run: the default powershell.exe (Windows PowerShell) or pwsh.exe - (PowerShell Core) if:

#requires -version 6

(or newer) is found in the script.

Properties

  • Script parameters - this field contains the list of parameters passed to the script. This field is of Formatted Type, so you can pass in the script results from other custom actions or values entered by the user.
  • 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.
  • Test script - use the button to check the functionality of your PowerShell script by running it and returning a TXT file that contains the Return Code and the Script Output.
  • Powershell Script Options - click on this hyperlink to open Powershell Script Options Dialog. This will allow you to configure script options like used platform, digital signature setting or preferred launch folder.

A custom action written in PowerShell can access Windows Installer properties in three ways:

Getting a property value into a script (for immediate custom actions)

To get a property simply include a line with the following syntax in your script:

$propValue = AI_GetMsiProperty YOUR_PROP

Where YOUR_PROP is the property name.

Getting a property value into a script (for deferred custom actions)

This can be done through the "Script Parameters" field as follows:

-firstPsParam [FIRST_MSI_PROP] -secondPsParam [SECOND_MSI_PROP]

FIRST_MSI_PROP and SECOND_MSI_PROP are MSI installer public properties. Their values will be assigned to the $firstPsParam and $secondPsParam parameters in the PowerShell script.
You need to update the Param() block of the script, which must be on the first line, as follows:

Param($firstPsParam, $secondPsParam)
# your script code here

Setting a property value temporarily from script for testing purposes

Use the "Test script" button and the "-testvalue" tag to change the value of a property temporarily in your script.

AI_GetMsiProperty YOUR_PROP -testvalue <VALUE>

Setting a property value from a script (for immediate custom actions)

To set a property simply include a line with the following syntax in your script:

AI_SetMsiProperty YOUR_PROP <VALUE> 

Where YOUR_PROP is the property and <VALUE> is the value assigned to it.

NoteSetting MSI installer property values works only when the PowerShell script has "Immediate" execution time. It does not work if the execution time is set to "When the system is being modified(deferred)". Also, the properties will be updated after the powerShell script runs.

Important"Wait for custom action to finish before proceeding" option from "Execution Options" field is mandatory for script custom actions and cannot be disabled before proceeding"

Caution!When there exists a GPO (Group Policy Object) restricting the execution of scripts, the digital certificate must be present in the Trusted Publishers in order for the script execution to succeed.

NoteWhen passed as a function parameter the, AI_GetMsiProperty statement must be enclosed between a set of parentheses, for instance:
myFunction(parameter1, (AI_GetMsiProperty PROPERTY_NAME), parameter3)

Run PowerShell Script From File

This custom action runs a PowerShell script from a file during the install process.

ImportantBuilt-in Windows PowerShell is the default tool used to run the script.

At install-time the custom action will select which PowerShell tool to run: the default powershell.exe (Windows PowerShell) or pwsh.exe - (PowerShell Core) if:

#requires -version 6

(or newer) is found in the script.

  • Script from disk - specify the file path of the PowerShell script that will be available on the target machine hard drive during the installation when the custom action runs. This field has Formatted Type so you can insert references to files, folders and properties.

TipThis path can point to an installed file from the Files and Folders Page - Installer Project if the custom action:
- is scheduled with sequence after InstallFiles standard action from Add Resources action group
- has execution time set to When the system is being modified (deferred)

  • Attached script - use the [ ... ] button on the right to select a PowerShell script file from your hard drive. This file will be attached to the installation so it can be used by the custom action. It won't be installed on the target machine.
  • Test script - use the button to check the functionality of your PowerShell script by running it and returning a TXT file that contains the Return Code and the Script Output.
  • Powershell Script Options - click on this hyperlink to open Powershell Script Options Dialog. This will allow you to configure script options like used platform, digital signature setting or preferred launch folder.

NoteTo get/set MSI properties on Immediate execution time, please use the approach from Run Inline PowerShell Script custom action.

NoteIt is not possible to get/set properties on this custom action type on Deferred execution time

Important"Wait for custom action to finish before proceeding" option from "Execution Options" field is mandatory for script custom actions and cannot be disabled.

Generate and install a self signed certificate

This custom action creates and installs a self signed certificate

Certificate

  • Thumbprint property - specify the thumbprint property

Store

  • Location - specify if the certificate should be placed under Current User store or under Local Machine store.
  • Name - specify the name of the list to include the certificate, for example, TrustedPublisher

Display 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 happened.

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

Properties

Error message - the message that will be displayed to the user. This field has Formatted Type so you can use the [ Edit ] button to insert reference to files, folders and properties. Localize it by referencing properties as described in How to localize the value of a property based on the OS language? article.

Display message box

This custom action will display a message box.

Properties

  • Title - the message box's title. This field is of Formatted Type and can be edited using Smart Edit Control.
    Please note that if your title contains a special character like the pipe "|" character, it must be escaped using "\" character so, for example, instead of My|Value, you should enter My\|Value.
  • Message - this is the message that will appear in the message box. This field is of Formatted Type and can be edited using Smart Edit Control.

NoteBoth Title and Message fields can be localized by referencing properties as described in How to localize the value of a property based on the OS language? article.

  • Icon - choose the appropriate icon to be displayed inside the message box.
  • Buttons - specify the button combination for the message box.
  • Default Button - this button will be selected by default when the message box is shown.
  • Output Property - this is the name of the property that will be set to different values depending on which button on the message box the user will press. When set to Deferred type this parameter should not be used because deferred custom actions can not set properties. The property will be set to one of the following values:
IDABORTAbort button was selected.
IDCANCELCancel button was selected.
IDCONTINUEContinue button was selected.
IDIGNOREIgnore button was selected.
IDNONo button was selected.
IDOKOK button was selected.
IDRETRYRetry button was selected.
IDTRYAGAINTry Again button was selected.
IDYESYes button was selected.
  • The text is right justified - align text to the right margin.
  • Displays message and caption text using right-to-left reading order on Hebrew or Arabic systems

Close application

This custom action allows you to close an application which uses a user Interface. It basically sends WM_CLOSE messages to all windows created by the application process.

After adding the custom action, in its Custom Action Properties pane the Process Name field should be set to the name of the main EXE of your application.

ImportantThis custom action closes the target application by sending WM_CLOSE messages to its windows. If this message is not treated by the application, it will not be closed.

By default the custom action closes windows which have a title-bar, a border and a system menu. If you want to specify custom style flags you can select them in the Windows Flags list or set the AI_CLOSEAPP_WINDOW_FLAGS property to the flags you want. For example, the property can be set to:

WS_SYSMENU | WS_OVERLAPPED | WS_VISIBLE

NoteModal windows are always ignored by the custom action. Also, custom flags should be used only when the default ones don't detect your application windows.

Detect process

This custom action allows you to detect a running process on the target machine. For more details please see the Detect or stop a process How-To.

Terminate process

This custom action allows you to stop a running process on the target machine. For more details please see the Detect or stop a process How-To.

Detect service

This custom action allows you to detect a service on the target machine. For more details please see the Detect or stop a service How-To.

Stop service

This custom action allows you to stop a service on the target machine.

Start service

This custom action allows you to start a service from the target machine.

Configure non admin service start

This custom action configures a service in order to allow stating it without Administrator privileges.

The custom action should be sequenced before starting the service in Install Execution Stage.

Check if user exists

This custom action allows you to check if a specific user account exists on the target machine or inside the installer. It was designed to work with the "LogonInformationDlg" dialog, but it can also be used separately.

Properties

  • Domain - this field needs to be set to the target user domain name. (DOMAIN_NAME property)

Caution!Leave the "Domain" field empty when checking a local user account.

  • Name - this field needs to be set to the target user name. (USER_NAME property)
  • Search in users/groups - choose whether the custom action will check in user groups or accounts. (equivalent to setting AI_USER_IS_GROUP property to 1 for checking user groups instead of accounts)
  • Check only user names and ignore profile names - if this option is set, the custom action will search only user account names (profile names are ignored). (equivalent to setting AI_USER_IGNORE_FULLNAME property to 1)
  • Ignore user accounts configured by this package - if this option is set, the custom action will ignore user accounts configured inside the installer. (equivalent to setting AI_USER_IGNORE_MSI property to 1)
  • Check user account's password - if this option is set, the custom action will validate the user account password. Please note that by default Windows does not allow validation of empty passwords. (equivalent to setting AI_USER_CHECK_PASSWORD property to 1)

NoteName and Domain are associated with the "User Name" and "Domain" edit controls on "LogonInformationDlg". After adding this dialog you can simply add the custom action as an Execute custom action published control event on its [ Next ] button.

Custom action return properties

  • AI_USER_EXISTS - after the custom action is executed, this property will be set to Yes if the user account exists or to No otherwise
  • AI_USER_VALID_PASSWORD - after the custom action is executed, this property will be set to Yes if the user account password is correct or to No otherwise. Please note that empty passwords may not be validated, so this property can be empty if a password is not provided.

Query SQL database for data

This predefined custom action executes an SQL query. Use the Choose SQL query link button to execute an SQL query added from the SQL Databases Page, Database server section.

ImportantThe SQL query can be triggered by scheduling this custom action in the install execution stage or by directly invoking it with a published/init event on a dialog.

Test ODBC connection

You can use this UI custom action when you want to validate user input parameters for an SQL ODBC Connection by testing the connection from within the "SQLConnectionDlg" dialog. For details please see: Test SQL Connection.

Send install information to your web server

You can use this UI custom action when you want to collect installation data and send it to your web server for processing. Install information can only be collected through Windows Installer properties (their values). For details please see: Collect installation data and send it to a web server.

Properties

  • Web Server URL - the URL where to submit the collected information. This field actually sets the value of HttpPostUrl property.
  • Suppress spawned message box - suppress the "Please wait..." message box during the HTTP POST request.
  • Property list - each property listed here will be sent as a POST variable, with its value set according to the installation state. This list control sets the value of HttpPostCollectData property.

Browse for file

This UI custom action will display an Open File dialog during the installation. See the Browse for file how-to article for details on how to configure your project.

Copy file/folder

Predefined custom action to copy files or folders.

Properties

Source

Specify the path of the file or folder to be copied (eg. c:\file.exe). This field is of Formatted type.

To pick a file/folder from the project, click on the [ ... ] button and select Browse file or Browse folder option.

Destination

Specify the path where the source file/folder should be copied (eg. c:\destination. This field is of Formatted type.

Overwrite existing files

Check this option if you want to overwrite existing files.

Run as administrator

Check this option to run the custom action with administrator privileges.

Use as 64-bit

Check this option to use a 64-bit process to copy the file/folder.

Predefined custom actions for working with ComboBox controls

Populate combo box, Delete from ComboBox and Extract ComboBox Data are UI-only custom actions that can be used to populate, delete from and extract data from ComboBox controls. See the ComboBox and ListBox controls tutorial for details and sample projects.

Predefined custom actions for working with List Box, List View and Check List controls

Populate List Box, Delete from List Box and Extract List Box Data are UI-only custom actions that can be used to populate, delete from and extract data from ListBox controls. See the ComboBox and ListBox controls tutorial for details and sample projects.

Populate List View, Delete items from List View and Extract List View Data are UI-only custom actions that can be used to populate, delete from and extract data from List View controls.

Populate Check List, Delete items from Check List and Extract Check List Data are UI-only custom actions that can be used to populate, delete from and extract data from Check List controls.

Update MSI edit controls

This UI-only custom action provides a workaround for a Windows Installer issue. For more information on how to use it please see: Set Edit control text on button push.

Set user interface Property from execute sequence

Changes in property(either public or private) values during Execute sequence are not available in UI Sequence. This custom action overcomes this limitation by migrating property values from Execute sequence to UI sequence.

For example, to transfer a property from Execute sequence to UI sequence, use the following expression in Action Data field of the custom action:

MyProp [MyProp]

If you just want to set a property on UI sequence from Execute sequence, use the following expression in Action Data field of the custom action:

uiprop newvalue

Resolve known folder path

This predefined custom action can be used to resolve a property based folder to the path of a known folder in Windows Vista (or later operating systems).

ImportantOn an earlier Windows versions this predefined custom action will not be able to resolve any Known Folder, so you should condition the installation of all components in that folder, based on the OS version. (e.g. VersionNT >= 600)

In order to use this predefined custom action in your project, follow the steps below:

a) Add the predefined Resolve known folder path custom action under "Wizard Dialogs Stage -> Searches".

NoteThe Resolve known folder path predefined custom action can be added under any standard action before Paths Resolution action group.

b) Keeping the SHIFT key pressed, drag-and-drop the custom action in tree control, under "Install Execute Stage -> Searches". This will create a copy of the action in the Install Execution Stage.

c) For both instances of the custom action add MY_VISTA_FOLDER_PROP property (for example) and associate it with the folder you need from the Edit Property Folder Association Dialog.

d) select “Advanced execution scenarios...” link button and set the scheduling option for the custom action to “Skip action in Install Execution Stage if executed in Dialogs Stage”.

e) In the Files and Folders page create a new property based folder, specifying the property from step c. You can now add content to this property based folder.

NoteAdd as many properties as you need in the same way.

Start image slideshow

This custom action will start an image slideshow configured in the Slideshow page. Please note that the custom action requires at least an Enterprise or Architect project when using a custom trigger for the start option. Also, excepting the "Expression" field in the " Execution Condition" section, it is recommended to keep the default settings of the custom action.

Stop image slideshow

This custom action will stop an image slideshow configured in the Slideshow page. Please note that the custom action requires at least an Enterprise or Architect project when using a custom trigger for the stop option. Also, excepting the "Expression" field in the " Execution Condition" section, it is recommended to keep the default settings of the custom action.

Check TCP port

This custom action allows you to check if a TCP port is free. For more details see the Check TCP port How-To.

Properties

  • Host name or IP (Optional) - the local computer's host name or IP (Optional). Equivalent to setting AI_BIND_TCP_HOST property. If not set, it will be assigned with 0.0.0.0 default value.
  • TCP port - TCP port to check. Equivalent to setting AI_BIND_TCP_PORT.

ImportantThis custom action can only be used to check local machine TCP port connections.

The custom action returns the check's result in the Windows Installer property AI_PORT_TEST_RES. The property can have the following values:

  • FreePort - the port is free
  • UsedPort - the port is used
  • SockError - an error occurred

Get a free TCP port

This custom action allows you to get a free TCP port. For more details see the Get a free TCP port How-To.

Properties

  • Host name or IP (Optional) - the local computer's host name or IP (Optional). Equivalent to setting AI_BIND_TCP_HOST property. If not set, it will be assigned with 0.0.0.0 default value.
  • TCP port - this field must be set to the port from which the search is started and it will also contain the free port returned by the search. Equivalent to setting AI_SEARCH_TCP_PORT.

If the port is free then the AI_SEARCH_TCP_PORT property will contain the port number of the free port and AI_PORT_TEST_RES will be set to FreePort. In case of an error, AI_PORT_TEST_RES will be set to SockError.

Preserve Install Type of the old version

This predefined custom action allows your package to use the same installation type as the version it upgrades through the automated upgrade feature. For example, your package will be installed per-user if it upgrades a per-user installation or it will be installed per-machine if it upgrades a per-machine installation.

ImportantThe package which uses this custom action should require Administrator privileges, otherwise, it may not be able to run. Therefore, your package should use a Per-user only (with administrator rights required) or Per-machine only (fails if user is not administrator) installation type.

NoteThis custom action uses the current package's Upgrade Code to find the older versions.

Uninstall previous versions

With this custom action you can uninstall the older versions of your product, no matter what Installation Type they use (per-user or per-machine). It can be used as a custom action without sequence or under Wizard Dialogs Stage.

TipIt is recommended to schedule this custom action before "Wizard Dialogs Stage" -> "Paths Resolution". This way it will run right before the installation starts.

NoteThe custom action uses the package's UpgradeCode to find the older versions.

Add network location

This predefined custom action allows you to automatically add a new shortcut to a shared network resource on the machine that runs the installer. In case the network location shortcut was previously created on the target machine, the custom action will overwrite it.

Properties

  • Name - specify the name under which the network path will be displayed (e.g. "My Location")
  • Path - specifies the network path for which the shortcut will be created (e.g. "\\Server\Shared")

NoteBoth properties must be set in order to successfully add the network location

Remove network location

This predefined custom action allows you to automatically delete an existent network location shortcut from the target machine. In case the network location shortcut doesn't exist this custom action will not make any modifications to the system.

Properties

  • Name - specify the name of the network location shortcut that will be deleted.

Get free disk space

This custom action retrieves the available disk space for a specific drive.

The target drive can be set in the Disk Path field from the custom action properties pane. Here are some examples of valid drives:

C
D:
E:\
[WindowsVolume]

The available disk size in MegaBytes is saved in the AI_FREE_DISK_SPACE installer property. You can use this property during installation, for example to compare it with a minimum disk size in a custom launch condition.

Play audio file

This custom action allows you to play an audio file during the installation. For more details please see the Play an Audio file How-To.

Install MSI relative to package

This custom action installs an 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 its sub-folders).

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 sub-folder of this folder - "c:\packages\test\subfolder\nested.msi"

Properties

  • MSI File - the location of the MSI file
  • Command line - command line parameters to be passed to the MSI file

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).

Configure MSI with specific 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.

Properties

  • MSI File - 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.
  • Command line - command line parameters to be passed to the MSI.

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

Collect features without CAB

ImportantThis custom action is used in How to show only the features with associated CAB files in the selection tree? article.

Its role is to append the IDs of all features with no associated .CAB files to the AI_DISABLED_FEATURES property. By using "One CAB archive per feature" option, associated implies:

  • each feature ID to match its .CAB file name
  • every .CAB file to be in the same location as the .MSI

This custom action has the following default settings which shouldn't be changed:

Disable Features

This custom action gets all features (by ID) from AI_DISABLED_FEATURES property and sets their InstallLevel to zero. This means that the features will not be visible in selection tree and they will not be installed.

It has the following default settings which shouldn't be changed:

Properties

  • Features - the comma separated list of features to be disabled. Choose the available features by pressing the [ Edit ] button.

Update Features Install States

This custom action updates all features' states by re-evaluating their conditions. A common usage scenario is to condition the features using public properties changed by the installing user when interacting with the package UI.

ImportantThe custom action cannot be used for features whose installation behavior was set by default to Disabled.

NoteWhen used during "Install Execution Stage" the action should be scheduled between CostFinalize and InstallValidate standard actions.

Process Data

This custom action takes any string, private or public property as input, performs a formatting operation on it, then outputs the result either by overwriting the input property or by setting a new property (or more in case of Extraction operation).

Input

  • Text - This field is of formatted type and aside text you can also reference properties that will be resolved to their values at install time.

Operation

  • Removal
    • What to remove - configure what will be removed from the input.
      • Trailing Backslashes - removes backslashes from the end of the text.
      • Leading Whitespaces - removes whitespaces from the beginning of the text.
      • Trailing Whitespaces - removes whitespaces from the end of the text.
      • All Whitespaces - removes all whitespaces from the text.
      • Custom - removes all characters selected by the regular expression defined in Removal regex field.
    • Removal regex - shows the regular expression of the predefined criteria or in case of Custom criteria you can define your own removal pattern.
  • Insertion
    • Where to insert at - configure where to insert the text.
      • Beginning
      • End
      • Custom - specify the exact insertion position.
    • Text to insert - this text will be inserted in the input text based on the selected criteria.
    • Position - when the Custom criteria is selected, the text will be inserted in this position.
  • Replacement
    • What to replace - configure what to replace in the input text.
      • Backslashes with slashes
      • Slashes with backslashes
      • Custom - perform the replace based on a matching regular expression.
    • Matching regex - shows the regular expression of the predefined criteria or you can define your own search pattern when the Custom criteria is selected.
    • Formatting regex - this string will replace the Matching regex selection when the Custom criteria is selected.
    • Convert - select the conversion criteria.
      • To Lower Case - replaces all upper case letters with lower case letters.
      • To Upper Case - replaces all lower case letters with upper case letters.
  • Extraction
    • What to extract - select what to extract from the input text.
      • Substring - extracts a substring with the specified length from the input text starting from the specified position.
    • Position - the start position for Substring criteria.
    • Length - when the Substring criteria is selected, this number will determine how many characters will be extracted from the input text starting from the specified position.
    • Tokenize using - configure a delimiter to tokenize the output properties.
      • Delimiter - extracts values from the input text established by the specified string delimiter to several(tokenized) output properties.
      • Custom delimiter - extracts values from the input text established by the specified regex pattern to several(tokenized) output properties.
    • Delimiter - this string will establish what values will be extracted from the input text. See the Output section for more details.
    • Extraction regex - the regex pattern that will establish what values from the input text will be extracted.
  • Matching
    • What to match - matches the input text against the text or regex. The result(0 or 1) will be saved in the output property.
      • Text - specify the matching text. The corresponding field is of formatted type and aside text, you can also reference properties that will be resolved to their values at install time.
      • Regex - if the regex pattern matches the input text entirely, the output property will be set to 1.

Output

  • Overwrite - the output processed data will overwrite the value of the input property.
  • Set new property - the property specified in the Property name field will be set to the output formatted data. Root property field is explained in the note below.

NoteWhen using the Extraction operation with Delimiter or Custom delimiter, the output properties will be tokenized based on the Root property (e.g. ROOT_PROPERTY_1, ROOT_PROPERTY_2, etc). AI_CUSTOM_EXTRACTION_PROP_COUNT Advanced Installer property is set to how many properties are output after extraction.

NoteWhen using the Matching operation the output property will be set to 1 if a match is found or 0 otherwise.

Install MSIX package

This custom action installs an MSIX package included in the installer.

Properties

  • MSIX Path - specifies the path to the MSIX.
  • External location - choose an external location for the MSIX.
  • Apply to all users - Provision the MSIX package per machine (to All Users) on an Windows machine. Digital Signature and Run as Admin option are required when using this flag.
    Please see this article for more information regarding per machine MSIX packages.

Uninstall MSIX package

This custom action uninstalls an existing MSIX package from the target computer.

Properties

  • Name - Name of the company and application, specified in the certificate used to sign the MSIX (e.g. YourCompany.YourApplication).
  • Version - The version of your application.
  • Architecture - Architecture required by the platform to run the MSIX.
  • Publisher ID - The Publisher ID, specified in the certificate used to sign the MSIX(e.g. CN=TestCert, O=MyCompany, L=MyCity, S=MyState).
  • Apply to all users - Remove the MSIX package per machine (All Users) on an Windows machine.Digital Signature and Run as Admin option are required when using this flag.
    Please see this article for more information regarding per machine MSIX packages.

Install certificate

This custom action installs a certificate included in the installer. It requires administrative privileges to run, so make sure you check "Run as Administrator" option from Install Parameters.

Certificate

  • Path - specifies the path to the certificate.

Store

  • Location - the system area where to install the certificate.
  • Name - the name of the certificate store.

ImportantCan only install certificates that have the CER extension.

Uninstall certificate

This custom action uninstalls a certificate included in the installer. It requires administrative privileges to run, so make sure you check "Run as Administrator" option from Install Parameters.

Certificate

  • Thumbprint - the thumbprint of the digital certificate; to select and extract it from the file use the [ ... ] button.

Store

  • Location - the system area where the certificate is kept.
  • Name - the name of the certificate store.

Resolve Formatted Property

This custom action expands the value of a property to a formatted text. For example if the property PROP has the initial value "[%PUBLIC]", after the execution of this custom action it's value will be changed to "C:\Users\Public".

  • Properties - in this section you could pick one or more properties to be expanded.

Topics