cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
chbiki
Level 6

LaunchApplication do not wait !!!

:confused:
Hi All,
Can somone help me out to resolve the follwoing problem:
the main Setup do not wait for the application started by LaunchApplication even if i set nTimeOut to INFINITE and nOptions to LAAW_OPTION_WAIT.

thank you in advance !

Chbiki
Labels (1)
0 Kudos
(8) Replies
Holger_G
Level 10

What type of application do you want to launch with LaunchApplication?
And please post your complete LaunchApplication call source code.
0 Kudos
chbiki
Level 6

:confused:
an .exe and after that a .msi, unfortunattly the .msi failed !!! her is the code:

export prototype Start_app(HWND);

function Start_app(hMSI)
STRING AppPath; // Stores the Path to the Application
NUMBER nBuff; // Buffer size
begin
nBuff = 256;
// Get the SourceDirectory - this directory is where your setup.exe or msi file is being launched

MsiGetProperty(hMSI, "SourceDir", AppPath, nBuff);

// add the directory of the folder and the name of the application to the AppPath variable
AppPath = AppPath + "subdir\\app.exe";

// Launch the application
if (LaunchApplication(AppPath, "", "", SW_HIDE, INFINITE, LAAW_OPTION_WAIT) < ISERR_SUCCESS)
then
MessageBox ("app.exe call failed!", SEVERE);
endif;

end;

The app has started succefully but the main setup go on and do not wait for this app.
0 Kudos
alanrickman
Level 4

I've never tried LaunchApplication not too say that it doesn't or shouldn't work. I use the code below, which in my installer successfully launches an application and waits for it to terminate.

if (LaunchAppAndWait (svProg, svCmd, WAIT) < 0) then 
MessageBox ("Failed to run application",SEVERE);
endif;
0 Kudos
MGarrett
Level 6

I once had a similar problem, where the app.exe file launched a second process. LaunchApplication then wouldn't wait for the second process to finish. If this is the case, modify your call to add LAAW_OPTION_WAIT_INCL_CHILD.



if( LaunchApplication(AppPath, "", "", SW_HIDE, INFINITE, LAAW_OPTION_WAIT_INCL_CHILD) < ISERR_SUCCESS ) then
MessageBox ("app.exe call failed!", SEVERE);
endif;

Not applicable

I bet the application you are launching is returning right away.

Try this:

open a command shell
navigate to the folder containing this file
attempt to launch it

Do you immediately recieve another command prompt line? Does the application continue to run?

If the MSI moves on then the application either failed to launch or already returned.
0 Kudos
chbiki
Level 6

🙂
Hi all,
many thanks for your help!
I have resolved the problem. The error was that the associated CA was set to "Asynchron" and it must be set to "Synchron", at the same time I had to use the option "LAAW_OPTION_WAIT_INCL_CHILD" for LaunchApplication().

Now the .exe and the .msi files can be started by the main setup, but i cant make those be run in the SILENT mode,
can anyone a way to do this?
Any helps are appreciated !
chbiki
0 Kudos
RainyS
Level 3

Set nTimeout to WAIT instead of INFINITE if you are using Installshield 2008.

LaunchApplication(CMD_LINE,"/s /v/qn","",SW_NORMAL,INFINITE,LAAW_OPTION_WAIT_INCL_CHILD|LAAW_OPTION_USE_SHELLEXECUTE);

It worked for me.
0 Kudos
RainyS
Level 3

Set nTimeout to WAIT instead of INFINITE if you are using Installshield 2008.

LaunchApplication(CMD_LINE,"/s /v/qn","",SW_NORMAL,WAIT,LAAW_OPTION_WAIT_INCL_CHILD|LAAW_OPTION_USE_SHELLEXECUTE);

It worked for me.
0 Kudos