AskDestPath Example

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

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

*

* InstallShield Example Script

*

* Demonstrates the AskDestPath function.

*

* This script calls AskDestPath to get the path to the location

* where the installation will install files. That path is then

* displayed in a message box.

*

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

 

#define TITLE_TEXT  "AskDestPath Example"

 

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

#include "Ifx.h"

 

export prototype ExFn_AskDestPath(HWND);

 

function ExFn_AskDestPath(hMSI)

    STRING  szTitle, szMsg, svDir;

    NUMBER  nReturn;

begin

 

    // Set a default path for the installation.

    svDir = INSTALLDIR;

 

    // Get a destination directory. Pass a null string in the

    // second parameter to display the default message.

    nReturn = AskDestPath (TITLE_TEXT, "", svDir, 0);

 

    if (nReturn < 0) then

        // Report the error.

        MessageBox ("AskDestPath failed.", SEVERE);

    elseif (nReturn = NEXT) then

        // Display the selected destination directory name.

        MessageBox ("You selected " + svDir + ".", INFORMATION);

    endif;

 

end;