FeatureFilterLanguage Example

InstallShield 2016 ยป InstallScript Language Reference

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

*

* InstallShield Example Script

*

* Demonstrates the FeatureFilterLanguage function.

*

* First, FeatureFilterLanguage is called to exclude all

* languages.  Next, GetSystemInfo is called to determine the

* target computer's default language/locale.

*

* Then, FeatureFilterLanguage is called again to include the

* language appropriate for the target computer.  If language

* support is not provided for the target computer, English is

* used.  Finally, the FeatureMoveData is called to create the

* installation.

*

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

 

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

#include "Ifx.h"

 

export prototype ExFn_FeatureFilterLanguage(HWND);

 

function ExFn_FeatureFilterLanguage(hMSI)

    STRING  szResult;

    NUMBER  nResult, nDisk;

begin

 

    // Filter out all language-specific file groups.

    FeatureFilterLanguage (MEDIA, ISLANG_ALL, TRUE);

 

    // Retrieve the target machine's default language/locale setting.

    GetSystemInfo (LANGUAGE, nResult, szResult);

 

    // Turn off filtering for file groups specific to the target

    // machine's default language/locale setting.

 

    switch (nResult)

        case ISLANG_FRENCH_CANADIAN:

            FeatureFilterLanguage (MEDIA, ISLANG_FRENCH_CANADIAN, FALSE);

        case ISLANG_FRENCH_STANDARD, ISLANG_FRENCH_BELGIAN, ISLANG_FRENCH_SWISS, ISLANG_FRENCH_LUXEMBOURG:

            FeatureFilterLanguage (MEDIA, ISLANG_FRENCH_STANDARD, FALSE );

        case ISLANG_GERMAN_STANDARD, ISLANG_GERMAN_SWISS, ISLANG_GERMAN_AUSTRIAN, ISLANG_GERMAN_LUXEMBOURG, ISLANG_GERMAN_LIECHTENSTEIN:

            FeatureFilterLanguage (MEDIA, ISLANG_GERMAN, FALSE);

        // Use English as a default.

        default:

            FeatureFilterLanguage (MEDIA, ISLANG_ENGLISH_UNITEDSTATES, FALSE);

    endswitch;

 

    // Transfer files for selected language.

    FeatureMoveData (MEDIA, nDisk, 0);

 

end;