SdLoadString Example

InstallShield 2019 » InstallScript Language Reference

Note • To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

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

*

* InstallShield Example Script

*

* Demonstrates the SdLoadString function.

*

* This script calls SdLoadString to get the string resource

* that is stored in _isres.dll with the ID IFX_MAINTUI_MSG.

* That string resource is then displayed in a message box.

*

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

 

#include "Ifx.h"

 

function OnBegin()

    STRING  svResource;

begin

 

    // Get the string resource.

    svResource = SdLoadString (IFX_MAINTUI_MSG);

 

    if (svResource = "") then

        // Report the error.

        MessageBox ("SdLoadString failed.", WARNING);

    else

        // Display the string resource.

        SprintfBox ( INFORMATION , "SdLoadString" ,

                   "Value of string resource %ld:\n%s" , IFX_MAINTUI_MSG,

                   svResource );

    endif;

    

end;