FeatureRemoveAllInMedia

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to InstallScript projects.

The FeatureRemoveAllInMedia is used during a maintenance installation to force the removal of all features that are in the current media and were installed previously. This function is generally called when the user selects the Remove option in the SdWelcomeMaint dialog.

When you call FeatureRemoveAllInMedia, only the features listed in the media header are removed; however, in the case of an updated application in which features were removed but not uninstalled during the update—that is, the features did not exist in the update media but did exist in the original media (and the update did not call FeatureRemoveAllInLogOnly)—whether or not these features are removed during uninstallation depends on whether the application was updated via a differential media or a full update media:

If the application was updated via a full media, the full media header replaces the original media header; therefore, these features are not removed during uninstallation.
If the application was updated via a differential media, both header files are present; therefore, FeatureRemoveAllInMedia removes these features.

To ensure that all installed features are uninstalled, an installation should call FeatureRemoveAllInMediaAndLog. This ensures that all features are removed.

Syntax

FeatureRemoveAllInMedia ( );

Parameters

None.

Return Values

FeatureRemoveAllInMedia Return Values

Return Value

Description

0

Indicates that the function successfully deselected all feature selections.

< 0

Indicates that the function was unable to deselect all feature selections.

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

Additional Information

Calling FeatureRemoveAllInMedia causes all features that are in the current media to be deselected. As a result, when FeatureTransferData is called, any features that have already been installed (determined by reading the installation log file, if it exists) are removed (uninstalled).

The installation determines whether or not features have been previously installed by reading the installation log file. If no valid log file is found during installation initialization (MAINTENANCE is FALSE), all features are considered not installed. In this case, calling FeatureRemoveAllInMedia causes all features to be deselected and not installed. However, a subsequent call to FeatureTransferData does not uninstall anything (since the log file contains the information regarding what to uninstall). Calling FeatureRemoveAllInMedia in this case is not recommended.

Note • FeatureRemoveAll also deselects all internal features, including the maintenance/uninstallation feature.

See Also