Enable

InstallShield 2012 Spring » InstallScript Language Reference

The Enable function activates the user interface object or setup feature specified by the parameter nConstant.

By default, an installation runs without a background. To enable window mode, you must call Enable with the BACKGROUND constant, and then again with DEFWINDOWMODE or FULLWINDOWMODE. These constants are not supported for use in Basic MSI installations.

Note: If your script calls the Disable function to disable the Next or Back button, that button is disabled in all dialogs displayed after that function call. To re-enable the Next or Back button, you must call Enable with the corresponding constant.

Syntax

Enable ( nConstant );

Parameters

Enable Parameters

Parameter

Description

nConstant

Specifies the user interface object or operational feature you want to enable. Pass one of the following predefined constants in this parameter:

BACKBUTTON—Enables the Back button that is displayed in some built-in dialogs. The Back button is enabled by default, but it can be disabled by calling the Disable function.
BACKGROUND—Displays the installation's main background window when the installation is in window mode. When installation is in full-screen mode, which is the default mode, this constant has no effect. To enable window mode, you must call Enable with the constant DEFWINDOWMODE or FULLWINDOWMODE.
CANCELBUTTON—Enables the Cancel button that is displayed in some built-in dialogs and the status dialog.
DEFWINDOWMODE—Configures the main background window to be a normal window with a title bar. If the background window is enabled, its appearance changes immediately. If the background window is not enabled, no change to the screen occurs until Enable is called with the constant BACKGROUND.
DIALOGCACHE—Enables the dialog cache mechanism, which eliminates the screen flash that appears between the display of dialogs. This screen flash is most noticeable in the title bar of installations running in window mode. Note that the dialog caching mechanism works only for dialogs that have BACK and NEXT buttons. Dialog caching is enabled by default.

Note: DIALOGCACHE has no effect on dialogs that do not have a Next or Back button.

FULLWINDOWMODE—Configures the main background window to be a maximized window with a title bar. If the background window is enabled, its appearance will change immediately. If the background window is not enabled, no change to the screen will occur until Enable is called with the constant BACKGROUND.
HOURGLASS—Causes the mouse cursor to change to the "Busy" cursor, an hourglass by default.
INDVFILESTATUS—Enables the display (on the second line of the progress indicator) of the fully qualified file name of each file as it is transferred when FeatureMoveData, CopyFile, or XCopyFile is called and the progress indicator is enabled.

nConstant (cont.)

LOGGING—Enables the logging of uninstallation information. When logging is enabled, results of operations that the InstallScript engine logs for uninstallation are recorded in the uninstallation log file and are reversed during uninstallation.

Note that logging is enabled automatically by default. If you need to disable logging, it is recommended that you do so by calling Disable with the LOGGING constant immediately before performing operations that should not be logged for uninstallation. Then you can re-enable logging by calling Enable with the LOGGING constant.

For more information about logging, see InstallScript Functions that Are Logged for Uninstallation.

NEXTBUTTON—Enables the Next button that is displayed by some built-in dialogs. On most dialogs, the Next button is enabled by default.

Note: Calling Enable with the BACKBUTTON constant has no effect on the SdCustomerInformation, SdCustomerInformationEx, SdRegisterUser, or SdRegisterUserEx dialogs since they enable and disable the Next button internally.

PCRESTORE—Enables System Restore compatibility, which is enabled by default.
REGISTRYFUNCTIONS_USETEXTSUBS—Enables text substitutions in strings that are passed to registry functions; this is enabled by default.
SELFREGISTERBATCH—Specifies whether to use the "batch method" for registering files copied with XCopyFile and the SELFREGISTER constant. The batch method is enabled by default.

When the batch method is disabled, files are registered immediately when copied with XCopyFile and the SELFREGISTER constant. If the batch method is enabled, registration is postponed until data transfer takes place.

SERVICE_DIFX_32—Enables DIFx support for 32-bit platforms.
SERVICE_DIFX_AMD64—Enables DIFx support for AMD 64-bit platforms.
SERVICE_DIFX_IA64—Enables DIFx support for Itanium 64-bit platforms.
STATUS—Enables the display of the progress indicator (status bar).
STATUSBBRD—Enables the display of the progress dialog that includes a billboard.
STATUSDLG—Enables the display of the dialog style progress indicator (status bar).
STATUSEX—Enables the display of the standard Setup Status dialog.
STATUSOLD—Enables the display of the old style progress indicator (status bar), which does not have a Cancel button.

nConstant (cont.)

UPDATE_SERVICE_INSTALL—This constant is obsolete.
USE_LOADED_SKIN—Intended for use with custom dialogs that will not work with dialog skins (for example, dialogs that are not the standard size); not recommended for use with built-in dialogs. Enables the use of the skin that you specified in the Specify Skin setting on the Build tab for the release in the Releases view. (If you selected the <Do not use any skin> option in that setting, this constant has no effect.) If you specify a skin, it is displayed by default; Disable(USE_LOADED_SKIN); and Enable(USE_LOADED_SKIN); are called internally by functions that display dialogs that cannot be displayed with a skin. Enabling of the skin applies only to dialogs that are displayed after you call Enable(USE_LOADED_SKIN); in your script. To enable skin use (after disabling it) for a custom dialog, you must call Enable(USE_LOADED_SKIN); before calling WaitOnDialog.

Project: The USE_LOADED_SKIN constant is applicable to InstallScript projects.

WOW64FSREDIRECTION—Enables 64-bit Windows file system redirection. You may need to do this after installing files to the WINSYSDIR64 destination. To learn more, see Targeting 64-Bit Operating Systems with InstallScript Installations.

Return Values

Enable Return Values

Return Value

Description

0

Indicates that the function successfully enabled the user interface object or setup feature specified by the parameter nConstant.

< 0

Indicates that the function was unable to enable the user interface object or setup feature specified by the parameter nConstant.

See Also