Custom Action Implementation in IDotNet Framework

Custom Action Implementation in IDotNet Framework

Robert Lv8

Custom Action Implementation in IDotNet Framework

Table of Contents

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

IDotNetCustomAction

https://techidaily.com

Declaration

IDotNetCustomAction : ICustomAction

https://techidaily.com

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

https://techidaily.com

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

Copy

https://techidaily.com

See also

ISearch

IAdvinstProjectTypes

Did you find this page useful?

Please give it a rating:

Thanks!

Report a problem on this page

Information is incorrect or missing

Information is unclear or confusing

Something else

Can you tell us what’s wrong?

Send message

Also read:

  • Title: Custom Action Implementation in IDotNet Framework
  • Author: Robert
  • Created at : 2024-10-14 00:55:28
  • Updated at : 2024-10-17 00:39:34
  • Link: https://fox-triigers.techidaily.com/custom-action-implementation-in-idotnet-framework/
  • License: This work is licensed under CC BY-NC-SA 4.0.