NumToStr Example

InstallShield 2015 ยป InstallScript Language Reference

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 NumToStr function

*

* This script calls NumToStr convert the numeric value of free

* disk space available on the system to a string so that it

* can be displayed by the MessageBox function.

*

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

 

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

#include "Ifx.h"

 

export prototype ExFn_NumToStr(HWND);

 

function ExFn_NumToStr(hMSI)

    STRING  svString;

    NUMBER  nSpace, nResult;

begin

 

    // Get the amount of free space on drive C.

    nSpace  = GetDiskSpace ("C:");

    

    // Convert the number to a string.

    nResult = NumToStr (svString, nSpace);

    

    if (nResult < 0) then

        MessageBox ("NumToStr failed.", SEVERE);

    else

        // Display the amount of free space on drive C.

        MessageBox (svString + " bytes free on drive C.", INFORMATION);

    endif;

 

end;