1. Script Creation
Create the VBS script.
For example : MyScript.vbs
Warning: Wise Package Studio does not recognize Wscript.
So the following command: Set WshShell = WScript.CreateObject(“WScript.Shell”)
Must be written like this: Set WshShell = CreateObject(“WScript.Shell”)
.
.
2. Custom Action Creation
In Windows Installer Editor
- Go to the MSI Script menu
- Select the Installation Mode: All Custom Actions
Select action: Call VBScript From Installation
.
Details Tab
Name the Custom Action
Browse the VBS file
.
Location Tab
Uncheck “No Sequence”
Sequence: Normal Execute Immediate/Deferred
Insert the Custom Action after InstallFinalize using the “Add” button
Condition: REINSTALL=”” OR NOT Installed
.
3. Conditions
Conditions can be set to launch the script only at the time of installation, or only when repairing, when uninstalling…
Here are the most used conditions for Custom Actions: