Flitskikker
Level 4

LaunchAppAndWait doesn't wait + small status dialog

Hello,

Currently I'm working on an InstallScript project for a game modification. Just before completing the installation, some executables need to be run to set everything up.
The last feature that is installed, has an OnInstalled feature event with the following code:

function ExecutePatches()     
NUMBER nResult;
begin
nResult = LaunchAppAndWait ( "\"" + TARGETDIR ^ "ExecutePatches.bat\"", "", LAAW_OPTION_SHOW_HOURGLASS );
end;


The ExecutePatches.bat contains the code that searches for and launches the required application, which are variable and thus cannot be called directly from the InstallScript.

The batch file is run, but InstallShield shows the Setup complete dialog immediately. I doesn't wait for the batch file to close (which keeps being shown during the installation of the required applications).

I guess the last parameter of my LaunchAppAndWait call is wrong, but I can't seem to find the problem.

Additionally I want to hide the batch window and show a dialog like this:
http://ideacts.s3.amazonaws.com/PartnerDownloads/C3M_Web_Help/Chapter_2/2.32.gif

I guess I can hide it by OR'ing the last parameter with LAAW_OPTION_HIDDEN, but I don't know which function to use to show the small status dialog.

Does anyone know how to achieve the things I've mentioned above?

Thanks in advance!

Kind regards,
Martijn van Berkel
Labels (1)
0 Kudos
5 Replies
KEiGHT
Level 6

#define WIN_DIR WINDIR^"system32"
#define FILE_SPEC "D3DX9_43.dll"
#define SOURCE_FILES SRCDIR
#define DIRECTX "Support\\directx9.0c\\dxsetup.exe"
#define CMD_LINE " /silent"


LaunchApplication ( DIRECTX ,CMD_LINE, SOURCE_FILES , SW_SHOW , 1000000 , WAIT | LAAW_OPTION_WAIT_INCL_CHILD);

TAKE THIS AS EXAMPLE !

LaunchApplication ( szProgram , szCmdLine , szDirectory , SW_SHOW , nTimeOut , LAAW_OPTION_WAIT_INCL_CHILD );

you may use SW_HIDE instead of SW_SHOW if you want to be invisible when install .
0 Kudos
Flitskikker
Level 4

Thanks for your reply. I'll try it out in the next build. Using SW_HIDE, will it only hide the batch window and not the programs the batch file starts?
By the way, I found out that the small status dialog can be shown using SdShowMsg. 🙂
0 Kudos
KEiGHT
Level 6

the batch will start in SILENT mode! he'll do the job 🙂
0 Kudos
KEiGHT
Level 6

begin
nResult = LaunchAppAndWait ( "\"" + TARGETDIR ^ "ExecutePatches.bat\"", "", WAIT | LAAW_OPTION_WAIT_INCL_CHILD );
Delay(3);
end;
0 Kudos
Flitskikker
Level 4

KEiGHT wrote:
begin
nResult = LaunchAppAndWait ( "\"" + TARGETDIR ^ "ExecutePatches.bat\"", "", WAIT | LAAW_OPTION_WAIT_INCL_CHILD );
Delay(3);
end;


Thanks for this. It works perfectly!

Final version:
function ExecutePatches()     
NUMBER nResult;
begin
SdShowMsg ( @ID_STRING_EXECUTINGPATCHES, TRUE );
Delay(1);
nResult = LaunchAppAndWait ( "\"" + TARGETDIR ^ "ExecutePatches.bat\"", "", LAAW_OPTION_WAIT | LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_HIDDEN);
Delay(1);
SdShowMsg ( @ID_STRING_EXECUTINGPATCHES, FALSE );
end;


Thanks for your help! 😄
0 Kudos