Disable Example

InstallShield 2012 Spring » InstallScript Language Reference

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the Disable and Enable functions.

*

* This script displays two dialogs.  In the first box, the

* Back button is disabled.  In the second box, the Next button

* is disabled and the Back button enabled.

*

\*--------------------------------------------------------------*/

 

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

 

export prototype ExFn_Disable(HWND);

 

function ExFn_Disable(hMSI)

begin

 

start:

 

    // Disable the Back button in setup dialogs.

    Disable (BACKBUTTON);

 

    // The following displays a dialog with the Back button disabled.

    SetupType ("", "", "", TYPICAL, 0);

 

    // Enable the Back button,

    Enable (BACKBUTTON);

 

    // Next button is disabled.

    Disable (NEXTBUTTON);

 

    // The following displays a dialog with only the Back button enabled.

    if (SetupType ("", "", "", TYPICAL, 0) = BACK) then

        // If the Back button is pressed, the Next button is enabled.

        Enable (NEXTBUTTON);

        goto start;

    endif;

 

end;