PDA

View Full Version : Question for LaunchAppAndWait



philoutte
05-04-2006, 02:03 AM
Hi,

I would like to know if I can launch a .jar file with the function LaunchAppAndWait. I tryed and it doesn't work but perhaps I do something wrong.

my code:

#define drive SRCDIR
#define jdk "\\next\\"

LaunchAppAndWait(drive ^ jdk + "jdk.exe","", LAAW_OPTION_WAIT);
LaunchAppAndWait(drive ^ jdk + "jboss.jar","", LAAW_OPTION_WAIT);

the first LaunchAppAndWait works perfectly but the second doesn't make anything.


Thank you.

michael.s.white
05-04-2006, 03:53 PM
Hi,

I would like to know if I can launch a .jar file with the function LaunchAppAndWait.


Thank you.


I believe that the installscript call does a CreateProcess so file associations will not work properly.

Have you tried running the java runtime with the jar file path in the command line? This should work. If you need to know the path to the java runtime you can always pull it out from the .jar file association in the registry.

philoutte
05-05-2006, 07:42 AM
thank you, I fond with not using this command.

But I have another problem always with LaunchAppAndWait:

*****************************************
if (AskYesNo(".....", YES) = NO) then

LaunchAppAndWait(RepSource ^ RepJdk + "jdk.exe","", LAAW_OPTION_WAIT);

endif;
*****************************************

it works when I have this code in OnBegin function but I need this later in the installation so I created a function named "essai" writen like this:

*****************************************
prototype void essai();

function void essai()

begin

if (AskYesNo("...", YES) = NO) then

LaunchAppAndWait(RepSource ^ RepJdk + "jdk.exe","", LAAW_OPTION_WAIT);

endif;

end;
*****************************************


As you can see, the code is exactly the same in the 2 cases and the function "essai" is called by simply writing " essai(); " after the welcome dialog.

In debug mode, the function is called, the application goes in the if statement and when it arrives on LaunchAppAndWait, it issues nothing (not even an error message).

So I would like to know, is there restriction using this or if you can say me where my error is.

best regards

batgrrl11
05-17-2006, 03:55 PM
I can't seem to get LaunchAppAndWait to work. I'm trying to launch an .sis file. This is the exmaple of my code

szCmd = "C:" ^ "Program Files" ^ "Folder ^ "file.sis";
LaunchAppAndWait ("\"" + szCmd + "\"", "", WAIT);

Or

szProgram = TARGETDIR ^ "file.sis";
LaunchAppAndWait ( szProgram , "" , WAIT );

Nothing seems to work. Please Help!

JL

RobertDickau
05-17-2006, 04:43 PM
Can you set the first argument to LaunchAppAndWait to be the application (EXE) to launch, then the second argument the specific .sis file?