Building Personalized Actions with .NET - An Intuitive Guide

Building Personalized Actions with .NET - An Intuitive Guide

Charles Lv8

Building Personalized Actions with .NET - An Intuitive Guide

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

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

https://techidaily.com

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

Copy

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: Building Personalized Actions with .NET - An Intuitive Guide
  • Author: Charles
  • Created at : 2024-10-08 18:49:47
  • Updated at : 2024-10-10 17:20:49
  • Link: https://fox-tips.techidaily.com/building-personalized-actions-with-net-an-intuitive-guide/
  • License: This work is licensed under CC BY-NC-SA 4.0.