IDotNetCustomAction

Declaration

IDotNetCustomAction : ICustomAction

Overview

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.

Properties

IFile AssemblyFile - Gets or sets the .net assembly file to the custom action executable file that will be launched with the specified parameters.

String ConfigFilePath - Get or sets the path that represents the location where the .NetCustActLauncher will create the assembly's configuration file. The configuration file contains the .NetFramework required version..

Array<INetParameter> Parameters - Gets the collection or parameters to pass information to your custom action.

Methods

AddParameter(String aName, String aValue) returns INetParameter - Creates and adds new parameter to custom action parameters collection.

RemoveParameter(INetParameter aParameter) - Removes and destroys the specified parameter.

Examples

$advinst = new-object -com AdvancedInstaller
$project = $advinst.CreateProjectS(“architect”)
$dllFile = $project.FilesComponent.AddFileS("appdir", "D:\DotNetCustomAction.dll")
$custActs = $project.CustomActionsComponent.NewLaunchInstalledFile($dllFile)

# There are 2 custom actions because “DotNetCustomAction.dll” is build for “Any CPU” platform
$custActs[0].ConfigFilePath = "[TempFolder]DotNetCustomAction.dll_Config.xml"
$custActs[0].AddParameter("new parameter", "parameter value")
$custActs[1].ConfigFilePath = "[TempFolder]DotNetCustomAction.dll_Config.xml"
$custActs[1].AddParameter("new parameter", "parameter value")

See also

ISearch

IAdvinstProjectTypes