SdShowDlgEdit1 Example

InstallShield 2019 » InstallScript Language Reference

Project • This information applies to the following project types:

InstallScript
InstallScript MSI

/*--------------------------------------------------------------*

*

* InstallShield Example Script

*

* Demonstrates the SdShowDlgEdit1 function.

*

* This example script calls SdShowDlgEdit1 to obtain the name

* of a folder, which is then displayed in a message box.

*

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

 

#include "Ifx.h"

 

function OnBegin()

   STRING szTitle, szMsg, szField1, svEdit1;

begin

   // Disable the Back button in setup dialogs.

   Disable (BACKBUTTON);

 

   // Set up parameters for call to SdShowDlgEdit1.

   szTitle  = "SdShowDlgEdit1 Example";

   szMsg    = "Please choose a folder for YourApp:";

   szField1 = "Target:";

   svEdit1  = "C:\\Example\\Target\\YourApp";

 

   // Get a target folder name from the user.

   if (SdShowDlgEdit1 (szTitle, szMsg, szField1, svEdit1) < 0) then

      // Report an error.

      MessageBox ("SdShowDlgEdit1 failed.", SEVERE);

 

   else

      // Display svEdit1 string variable.

      SprintfBox (INFORMATION, szTitle, "You selected %s", svEdit1);

 

   endif;

 

end;