AskDestPath

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The AskDestPath function displays a dialog that enables the end user to specify a destination folder for the files to be installed by your installation. The dialog also includes a Browse button that enables the end user to select an existing folder on the system.

To open the Choose Folder dialog from the Choose Destination Location dialog, the end user must click the Browse button. The Choose Folder dialog displays a list of all available folders. The end user can select an existing folder or enter a new folder name. If the end user enters the name of a folder that does not exist, a message box opens to enable the end user to create the folder.

Note: Installations that run in silent mode should create the new folder if it does not exist before calling AskDestPath. This ensures that the confirmation dialog is not displayed. Without this step, two response files are required to handle the two possible conditions.

The folder selected by the end user must be writable; non-writable folders are not accepted. If you want the end user to be able to select folders that are not writable, call the AskPath function instead.

Syntax

AskDestPath ( szTitle, szMsg, svDir, nReserved );

Parameters

AskDestPath Parameters

Parameter

Description

szTitle

Specifies the title of the dialog. To display the default title Choose Destination Location, pass a null string ("") in this parameter.

szMsg

Specifies the message to display in the dialog. To pass multiple lines of static text in this parameter, insert newline escape sequences ( \n ) where needed to break the line. To display the default instructions for this dialog, pass a null string ("") in this parameter.

svDir

Specifies the default path to display when the dialog is opened; returns the path to the folder selected by the end user.

Note: If the default folder specified by svDir does not already exist on the end user's system, it is not created unless the end user clicks the Browse button and follows the steps to create it from the Choose Folder dialog. Therefore, whenever you specify a default folder that you intend to use before calling FeatureMoveData (which creates the folder if necessary), you must call ExistsDir when AskDestPath returns in order to determine whether that folder exists. If it does not exist, call CreateDir to create it on the end user's system. Note that FeatureTransferData is called automatically in an installation running an event-based script.

nReserved

The value of this parameter must be 0 (zero).

Return Values

AskDestPath Return Values

Return Value

Description

NEXT (1)

Indicates that the end user clicked the Next button.

BACK (12)

Indicates that the end user clicked the Back button.

Additional Information

To view an example of this or other dialogs for your installation, use the Dialog Sampler. In InstallShield, on the Tools menu, point to InstallScript, then click Standard Dialog Sampler or Skinned Dialog Sampler.

See Also