FeatureSelectItem Example

InstallShield 2014 ยป InstallScript Language Reference



* InstallShield Example Script


* Demonstrates the FeatureSelectItem function.


* This example script demonstrates a function that sets a

* feature's status to either selected or not selected.


*  Comments:  To run this example script, create a project (or

*             insert into a project) with several features and/or

*             subfeatures with components containing files.  




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

#include "Ifx.h"


// Include iswi.h for Windows Installer API function prototypes and constants,

// and to declare code for the OnBegin and OnEnd events.

#include "iswi.h"


// The keyword export identifies MyFunction() as an entry-point function.

// The argument it accepts must be a handle to the Installer database.

   export prototype MyFunction(HWND);


// To Do:  Declare global variables, define constants, and prototype user-

//         defined and DLL functions here.


function MyFunction(hMSI)


    STRING  svDir, szTitle, szMsg;




    svDir   = INSTALLDIR;

    szTitle = "Select Features";

    szMsg   = "Select the features you want to install on your computer.";


    // Set the selection status of Subfeature2 to not selected.

    FeatureSelectItem (MEDIA, "Feature1\\Subfeature2", FALSE);


    // Display available features.

    SdFeatureTree (szTitle, szMsg, svDir, "", 2);