FeatureInitialize

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to InstallScript projects.

The FeatureInitialize function is supported only for compatibility with scripts created in earlier versions of InstallShield. It is recommended that you avoid using multiple file media libraries in InstallShield because they are no longer necessary and they can break your installation.

The FeatureInitialize function associates a media name with a file media library and prepares that media library for access.

Syntax

FeatureInitialize ( szMediaLibrary, szMediaLibraryFile );

Parameters

FeatureInitialize Parameters

Parameter

Description

szMediaLibrary

Specifies the media name to associate with the file media library whose files are to be transferred with FeatureMoveData Example.

The media name Data is reserved for use with Data1.cab, the default file media library. You may not pass Data in the parameter szMediaLibrary.

szMediaLibraryFile

Specifies the file name of the file media library to be initialized. The file name must be in the format xxx1.cab; for example, second1.cab or wow1.cab. Do not specify a path; this file must reside in the installation's source folder (SRCDIR).

Return Values

FeatureInitialize Return Values

Return Value

Description

0

FeatureInitialize was successful.

< 0

FeatureInitialize failed.

You can obtain the error message text associated with a large negative return value—for example, -2147024891 (0x80070005)—by calling FormatMessage.

Additional Information

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

A file media library that is initialized with FeatureInitialize must be installed by calling FeatureMoveData. FeatureTransferData fails if called to install such a media library.

If an installation installs file media libraries that are initialized with FeatureInitialize, the uninstallation must be enabled by calling DeinstallStart rather than MaintenanceStart. (This is the case because files must be installed by calling FeatureMoveData, which does not support maintenance setups.)

The maintenance/uninstallation feature that is stored in szMediaLibraryFile is not installed by FeatureMoveData; only the first call to FeatureMoveData, before calling FeatureInitialize, can install a file media library's maintenance/uninstallation feature.

It is not necessary to call FeatureInitialize before accessing the default file media library (Data1.cab) using the default media name Data. The default media is initialized automatically during installation initialization. The file media library must reside in the installation’s source folder. The name of this folder is assigned to the system variable SRCDIR during installation initialization.

See Also