Running an Application from an InstallScript Installation

This topic may seem simple but the question arises frequently enough.  How do you run an external program from within an InstallScript installation?

In an InstallScript installation, you can do it with two functions, LaunchApp and LaunchAppAndWait.  LaunchApp calls LaunchAppAndWait, and LaunchAppAndWait calls LaunchApplication.

LaunchApp takes two parameters:

     APPLICATION: the application to run

     CMD_LINE: The path to the application

Here is an example using LaunchApp:

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

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

endif;

LaunchAppAndWait takes three parameters:

     LaunchAppAndWait(APPLICATION,CMD_LINE,OPTIONS);

     APPLICATION - the application to run

     CMD_LINE – the path to the application

     OPTIONS – the options for running the application.  The various options allow you to wait while the application is ran, to not wait while the application is ran, whether to show an hourglass cursor, whether the application window is hidden, minimized, or maximized.  There are other useful options.  Consult the InstallShield Help for the LaunchApplication function to see the entire list of options.

Here is an example using LaunchAppAndWait:

if (LaunchAppAndWait(APPLICATION,"",nOptions) < 0) then

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

endif;

For a full explanation of these functions in their entirety, consult the InstallShield Help.

Dreamweaver FTP Problem

Leave a Comment

Security Code: