FeatureListItems Example
InstallShield 2022 ยป InstallScript Language Reference
/*--------------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the FeatureListItems function.
*
* This example script demonstrates a function that lists all
* subfeatures under a specified feature.
*
* 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 szTitle, szMsg;
NUMBER listID;
begin
szTitle = "List MEDIA Features";
szMsg = "MEDIA contains the following top-level features:";
// Initialize the string list.
listID = ListCreate (STRINGLIST);
// Create a list of top-level features in the specified media.
FeatureListItems (MEDIA, "", listID);
// Display the list of top-level features.
SdShowInfoList (szTitle, szMsg, listID);
end;