Custom Actions Component: Enhance Your App with Tailored Functionality

Custom Actions Component: Enhance Your App with Tailored Functionality

Timothy Lv8

Custom Actions Component: Enhance Your App with Tailored Functionality

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.

ICustomActionsComponent

Declaration

ICustomActionsComponent : IDispatch

https://techidaily.com

Overview

This component is meant to create and manage existing predefined custom actions.

Properties

Array CustomActions - Gets existing custom actions.

https://techidaily.com

Methods

NewLaunchInstalledFile(IFile aFile) returns IInstalledFileCustomAction
- Creates custom action for launching installed file.

NewLaunchInstalledScriptFile(IFile aFile) returns IInstalledScriptFileCustomAction
- Creates custom action for launching installed script file.

NewLaunchAttachedFile(String aSourcePath) returns IAttachedFileCustomAction
- Creates custom action for launching attached file.

NewLaunchAttachedScriptFile(String aSourcePath) returns IAttachedScriptFileCustomAction
- Creates custom action for launching attached script file.

NewAttachedNativeDllFunctionCall (String aDllSourcePath) returns IAttachedDllFunctionCallCustomAction
- Creates custom action for calling function from attached native dll

NewInstalledNativeDllFunctionCall(IFile aInstalledDll) returns IInstalledDllFunctionCallCustomAction
- Creates custom action for calling function from installed native dll

NewLaunchFileFromDisk(String aFileToLaunch) returns IFileCustomAction
- Creates custom action for launching existing file from disk.

NewLaunchExeWithWorkingDirectory(IFolder aWorkingDirectory) returns IExeWithWorkingDirectoryCustomAction
- Creates custom action for launching executable file specifying the working directory.

NewDotNetCustomAction(IFile aDotNetDll) returns Array
- Creates 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. Can return 2 custom action objects, one for x86 and one for x64 when dll is built for “Any CPU” platform.

NewLaunchInstalledFile(IFile aFile) returns IInstalledFileCustomAction
- Creates custom action for launching installed file.

NewLaunchFileFromProperty(String aPropertyName) returns IFileFromPropertyCustomAction
- Creates custom action for launching executable file using a property.

NewLaunchScriptFileFromProperty(String aPropertyName) returns IScriptFileFromPropertyCustomAction
- Creates custom action for launching script file using a property.

NewPowershellScriptFileFromDisk creates custom action for executing an existing PowerShell script file from target machine.

NewPowershellAttachedScriptFile(String aScriptSourcePath) returns IPowershellAttachedScriptFile
- Creates custom action for executing and attached PowerShell script file.

NewInstallCertificate(String aCertificateFile, String aStoreName) returns IInstallCertificate
- Creates custom action that installs a certificate included in the installer. It requires administrative privileges to run, so make sure you set “Run as Administrator” option from Install Parameters.

NewUninstallCertificate(String aCertificateThumbprint, String aStoreName) returns IUninstallCertificate
- Creates custom action that uninstalls a certificate. It requires administrative privileges to run, so make sure you set “Run as Administrator” option from Install Parameters.

RemoveCustomAction(ICustomActions aCustomAction)
-Removes an existing custom action .

Example

$advinst = new-object -com AdvancedInstaller
$project = $advinst.CreateProjectS(“architect”)
$appFile = $project.FilesComponent.AddFileS(“appdir”, “D:\MyApp.exe”)
$project.CustomActionsComponent.NewLaunchAttachedScriptFile(“d:\my_script.vbs”)

Copy

See also

ICustomAction

ICustomActionSequence

https://techidaily.com

Topics

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 Actions Component: Enhance Your App with Tailored Functionality
  • Author: Timothy
  • Created at : 2024-10-05 18:26:29
  • Updated at : 2024-10-10 20:59:19
  • Link: https://fox-within.techidaily.com/custom-actions-component-enhance-your-app-with-tailored-functionality/
  • License: This work is licensed under CC BY-NC-SA 4.0.