PDA

View Full Version : Example script for launching program at finish



mhanson
03-14-2005, 06:16 PM
Hello All.

I am new to InstallScript code and am looking for a small example of how to allow the user to choose to launch a specifically installed file, (eg. a .exe), on the Finish screen. Does anyone have such an example, or a location I might look to find more info? I do know that I need to work with SdFinish, though I work much better with an example then with a help file entry... :D

Thanks.

TsungH
03-14-2005, 06:21 PM
If you have not, please read up on SdFinish Example in InstallScript Language Reference.

RadhaK
03-15-2005, 01:52 AM
Hi,

The LaunchAppAndWait function launches the application(exe) specified by szProgram with the command-line parameters specified by szCmdLine. The third parameter, nOptions, specifies various options, including whether or not the installation should wait until the launched application terminates before continuing. Use this function in “After Move Data” sequence at the end of OnFirstUIAfter() function.

Example

function OnFirstUIAfter()
STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
NUMBER bvOpt1, bvOpt2;
NUMBER bShowUpdateServiceDlg;
begin
ShowObjWizardPages(NEXT);
szTitle = "";
szMsg1 = "";
szMsg2 = "";
szOpt1 = "";
szOpt2 = "";
bvOpt1 = FALSE;
bvOpt2 = FALSE;
// Set this to true if you have the update service enabled, and if you want to check for updates.
// Note: the ISUS Starter Edition does not support checking for updates programatically. So,
// only set this to true if you have at least the ISUS Professional Edition.
bShowUpdateServiceDlg = FALSE;

//{{IS_SCRIPT_TAG(Dlg_SdDinishEx)

if ( BATCH_INSTALL ) then
SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
else
// If the update service is enabled, show finish dialog that includes
// update check option.
if( bShowUpdateServiceDlg && ( ENABLED_ISERVICES & SERVICE_ISUPDATE ) ) then

if( SdFinishUpdateEx( szTitle, szMsg1, szMsg2, szOpt1, szOpt2, TRUE ) ) then

// Don't check for updates in silent mode.
if( MODE != SILENTMODE ) then
UpdateServiceCheckForUpdates( "", FALSE );
endif;
endif;
else
SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bvOpt1 , bvOpt2 );
endif;
endif;
//}}IS_SCRIPT_TAG(Dlg_SdDinishEx)
LaunchAppAndWait("Notepad.exe","",nWait);
end;

To know more about LaunchAppAndWait function, check the below Installshield Helpnet article

http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield10-5langref/LangrefLaunchAppAndWait.htm