09.12.2012 Views

InstallShield 2012 Express Edition User Guide - Knowledge Base ...

InstallShield 2012 Express Edition User Guide - Knowledge Base ...

InstallShield 2012 Express Edition User Guide - Knowledge Base ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 10: Customizing Installation Behavior<br />

Using Custom Actions<br />

Adding an .exe Custom Action to Your Project<br />

The items in the Custom Actions view are organized by chronological order, according to when they are<br />

launched during installation or uninstallation. When you add a custom action to your project, you<br />

specify when the custom action should be launched by adding the action to the appropriate installation<br />

or uninstallation item.<br />

Task To add an .exe custom action to your project:<br />

1. In the View List under Define Setup Requirements and Actions, click Custom Actions.<br />

2. In the Custom Actions During Installation explorer, the Custom Actions During<br />

Maintenance explorer, or the Custom Actions During Uninstallation explorer, click the item<br />

that should contain the custom action that you want to create.<br />

3. Right-click the item and click New EXE. <strong>InstallShield</strong> adds a new custom action with the name<br />

NewCustomActionn (where n is a successive number).<br />

4. Type a name for the custom action.<br />

5. Configure the settings for the custom action.<br />

Configuring an .exe Custom Action’s Settings<br />

When you add an .exe file custom action to your project, you need to configure its settings.<br />

Task To configure the settings for an .exe custom action in your project:<br />

1. In the View List under Define Setup Requirements and Actions, click Custom Actions.<br />

2. In the Custom Actions During Installation explorer, the Custom Actions During<br />

Maintenance explorer, or the Custom Actions During Uninstallation explorer, click the<br />

custom action that you want to configure.<br />

3. Configure the settings in the grid on the right.<br />

VBScript and JScript Custom Actions<br />

Depending on your installation’s requirements, you may need to create a custom action that calls an<br />

existing VBScript file (.vbs) or JScript (.js). To learn how to create this type of custom action, see Adding<br />

a VBScript or JScript Custom Action to Your Project.<br />

VBScript Custom Action Example<br />

The following is an example of a VBScript custom action that determines the value of INSTALLDIR and<br />

changes it depending on the presence of a file.<br />

' Get the value of INSTALLDIR<br />

Dim sInstalldir<br />

228 ISE-1800-UG01 <strong>InstallShield</strong> <strong>2012</strong> <strong>Express</strong> <strong>Edition</strong> <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!