How to add Custom Actions in Wise Package Studio

Written by Horatiu Vladasel · November 28th, 2022 · 2min read

Custom Actions are user-defined actions that enhance the installation process by adding functionalities beyond what is offered by the standard Windows Installer actions. They are necessary when built-in options fail to meet specific installation requirements.

Custom Actions can be implemented in various ways, including:

  • Compiling custom DLLs using the C/C++ API
  • Embedding VBScript or JScript snippets
  • Explicitly invoking system commands

While all methods are valid, VBScript Custom Actions are the most common. That’s what we’ll use in our article.

How to Add a Custom Action to Your MSI Package Using Wise Package Studio

Let’s say you need to add two Custom Actions to your MSI package:

  • One that runs during installation.
  • Another that runs during uninstallation.

Once you have the corresponding VBScripts ready, follow these steps:

1. Go to MSI Script and select “Call VBScript from Embedded Code”.

Custom Actions in Wise Package Studio

2. Name the Custom Action and paste the VBScript content you want to execute.

Enter VBScript function to execute

3. Set the sequence and condition for the Custom Action. to be executed. For example, to make it run during installation, use the condition: Not Installed.

Set sequence and condition for the Custom Action

4. Configure the scheduling and processing options.

Set Custom Action properties

ImportantKeep in mind that Immediate Custom Actions run in the user's context, should not modify the system, and are executed in sequence. They cannot rely on any files being installed by the MSI.

And that’s it. Now, your new CustomAction will be shown in the CustomAction list.

New Custom Action in CA list

Similarly, you can create a Custom Action during uninstallation. The only difference between the two of them is the condition, which for an uninstall Custom Action should be set as follows:

Create Custom Action during installation

Once you set your Custom Action(s), you can compile your Wise Project file and build your MSI installer.

Compile and build your Wise Installer Project

How to Add Custom Actions Using Advanced Installer

Advanced Installed dedicated GUI is even more intuitive and easier to use, as you can see in the video below.

Moreover, it comes with lots of predefined Custom Actions which you can use straight away.

If you want to find out more, you can check out our Custom Actions page and check out our Advanced Installer 30-day full-feature trial.

Written by
See author's page
Horatiu Vladasel

Horatiu is a Software Packager/Sequencer with over 10 years experience, who has worked as a Software Packager at IBM and is currently offering software packaging services to companies such as BT or Nationwide.

Comments: