FeatureSetTarget

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The FeatureSetTarget function assigns the value of szLocation to the public property (in InstallScript MSI projects) or property variable (in InstallScript projects) that is specified by szPropertyVar. Properties or property variables can be used in the Destination field of the Components view and in the Target field of a shortcut in the Shortcuts view. Call FeatureSetTarget before calling FeatureMoveData.

Note: This function cannot be used with script-created feature sets.

This function cannot set the value of an object’s property variable. To set the value of an object’s property variable, you must use the object’s ScriptDefinedVar property; see the object’s help page for details. (You can display an object’s help page by selecting the object in the Objects view or, if the object is included in your project, the Features or Setup Design view.) For information on adding the ScriptDefinedVar property to an object that you have created, see Add a ScriptDefinedVar Property to My Object .

In InstallScript MSI projects, this function was designed to set paths for public properties that are in the Directory table. You can create a new directory by clicking a component’s destination or a shortcut’s target, and creating a new directory. This newly created directory has TARGETDIR as its Directory_Parent. Through script, you can use FeatureSetTarget to set this public property (directory).

Syntax

FeatureSetTarget ( szFeatureSource, szPropertyVar, szLocation );

Parameters

FeatureSetTarget Parameters

Parameter

Description

szFeatureSource

Specifies the media name of the file media library whose user-defined variable is to be set.

szPropertyVar

Specifies the user-defined variable. In InstallShield, user-defined variables take the form <variable name>.

Project: (InstallScript MSI only:) The property used in this parameter must be a public property. You do not need to create an entry in the Property Manager for this property. If you intend to use the property as a destination, you must use it as a component’s destination, not a feature’s destination.

szLocation

Specifies the path expression to substitute for the user-defined variable. This string should not include extra quotation marks, even if it specifies a long path. The value of szLocation can be a complete path—including drive letter and colon—or a partial path, depending on how szPropertyVar is used.

Return Values

This function always returns 0.

See Also