SdFinish Example

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to the following project types:

InstallScript
InstallScript MSI

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

*

* InstallShield Example Script

*

* Demonstrates the function SdFinish.

*

* Note: Before running this script, set the preprocessor

*       constants so that they reference the fully-qualified

*       names of the Windows Notepad executable and a valid

*       text file in the Support Files/Billboards view.

*

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

 

//Assign the name of a text file to READMEFILE

#define NOTEPAD WINDIR ^ "Notepad.exe"

#define READMEFILE SUPPORTDIR ^ "ReadMe.txt"

 

#include "Ifx.h"

 

function OnBegin()

    STRING   szProductName, szTitle;

    STRING   szMsg1, szMsg2, szOpt1, szOpt2;

    BOOL     bvOpt1, bvOpt2;

    NUMBER   nReturn;

begin

 

    // Set the product name to substitute for the %P place holder.

    szProductName = "My Application";

    SdProductName (szProductName);

 

    // Setup parameters that will be passed to SdFinish.

    szTitle = "SdFinish Example";

    szMsg1  = "%P Setup is almost complete.\n" +

              "Choose the options you want below.";

    szMsg2  = "Click Finish to complete %P Setup.";

    szOpt1  = "I would like to view the README file.";

    szOpt2  = "I would like to launch %P.";

    

    // Display the SdFinish dialog.

    SdFinish (szTitle, szMsg1, szMsg2, szOpt1, szOpt2, bvOpt1, bvOpt2);

    

    if (bvOpt1) then

        // Display the read me file.

        LaunchAppAndWait (NOTEPAD, READMEFILE, WAIT);

    endif;

    

    if (bvOpt2) then

        // Because this example does not actually install an

        // application, a message box is displayed in place of

        // the call to LaunchApp that would normally be made here,

        // for example:

        //   LaunchApp (TARGETDIR ^ "MyApp.exe","");

    

        SprintfBox (INFORMATION, szTitle, "Launch %s here.", szProductName);

    endif;

 

end;