AskYesNo Example

InstallShield 2016 » InstallScript Language Reference

Project • This information applies to the following project types:

Basic MSI
InstallScript
InstallScript MSI

Note • 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 AskYesNo function.

*

* This script asks the user whether or not to display the

* ReadMe file.  If yes, the script launches the Windows

* Notepad to open a ReadMe file.

*

* 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 on the target system.

*

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

 

#define PROGRAM "C:\\Windows\\Notepad.exe"

#define PARAM   "C:\\Windows\\Readme.txt"

 

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

#include "Ifx.h"

 

export prototype ExFn_AskYesNo(HWND);

 

function ExFn_AskYesNo(hMSI)

begin

 

    // Display the AskYesNo dialog.  The default is set to Yes.

    if (AskYesNo("Installation complete. Would you like to read the Readme " +

                "file now?", YES) = YES) then

        LaunchApp(PROGRAM, PARAM);

    endif;

 

end;