LaunchApp Example

InstallShield 2014 ยป InstallScript Language Reference

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 LaunchApp function.

*

* LaunchApp is called to execute an application.

*

* 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 APPLICATION WINDIR^"Notepad.exe"

#define CMD_LINE    WINDIR^"Readme.txt"

 

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

#include "Ifx.h"

 

export prototype ExFn_LaunchApp(HWND);

 

function ExFn_LaunchApp(hMSI)

begin

 

    // Launch the Windows Notepad application to edit

    // the Windows Readme.txt file.

    if (LaunchApp (APPLICATION, CMD_LINE) < 0) then

        MessageBox ("Unable to launch "+APPLICATION+".", SEVERE);

    endif;

 

end;