cancel
Showing results for 
Search instead for 
Did you mean: 
chbiki
Pilgrim

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
Pilgrim

Re: LaunchApplication do not wait !!!

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

Re: LaunchApplication do not wait !!!

: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
Highlighted
alanrickman
Pilgrim

Re: LaunchApplication do not wait !!!

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
Flexera beginner

LaunchApplication

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;

0 Kudos
Not applicable

Re: LaunchApplication do not wait !!!

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
Pilgrim

Re: LaunchApplication do not wait !!!

Smiley Happy
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
Pilgrim

Try this

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
Pilgrim

Try this

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