PDA

View Full Version : LaunchAppAndWait



LAlexander
10-22-2003, 06:27 AM
Could there be an bug in the LaunchAppAndWait function. When i call this function with short file names like

LaunchAppAndWait("C:\test\setup.exe", "/s /x /u", WAIT);

it also works with long filenames for the executable, like this

LaunchAppAndWait("C:\test testlong\setup.exe", "/s /x u", WAIT);

but it don't work when i want to give long path names for my command line parameter, like this:

LaunchAppAndWait("C:\test testlong\setup.exe", "/s /x /u"c:\this is long\test.txt" ", WAIT);

have anybody an idea why it won't work?
thanks in advance
alex

RobertDickau
10-22-2003, 09:01 AM
One general point: in InstallScript strings, you'll want to express backslashes as double backslashes, as in:

"C:\\test test\\something.exe"

The escape sequence \t is interpreted as a tab character, about which see the DevStudio help page "Escape Sequences".

RichAquino
10-22-2003, 12:44 PM
Hi,

You'll also want to express quotes with backslashes:

i.e.
Instead of this:
LaunchAppAndWait("C:\test testlong\setup.exe", "/s /x /u"c:\this is long\test.txt" ", WAIT);

Do this:
LaunchAppAndWait("C:\\test testlong\\setup.exe", "/s /x /u\"c:\\this is long\\test.txt\" ", WAIT);

Rich

LAlexander
10-23-2003, 12:19 AM
This was just an example!! i used double blackslashes and qoutes. My focus on my post was the problem with the "long file names" . Could it be that the function LaunchAppAndWait have problem with long file names? (It could be possible, because it calls the command, that just support short file names)

RichAquino
10-23-2003, 03:18 PM
Hi,

LaunchAppAndWait uses CreateProcess, which supports long file names.

I believe the problem is in the command line itself.

Is this a different problem than the one you posted in this (http://community.installshield.com/showthread.php?s=&threadid=124634) thread?

Rich

LAlexander
10-24-2003, 02:44 AM
this is a similary problem. here me detailed problem. i start two programms with LaunchAppand Wait. I got the first one running, by using following syntax ( i wrote everything in the commandline parameter)

LaunchAppAndWait("",INSTALLDIR ^ "\\Install\\Setup.exe " + "/sms /s /f1\"" + INSTALLDIR ^ "Install\\setup.iss" + "\"",LAAW_OPTION_WAIT)

that works, but it doesn't work if i write the first part of the string in the first parameter(INSTALLDIR ^ "\\Install\\Setup.exe") of the fckt.

well, and my second use of LaunchAppandWait looks like this:

LaunchAppAndWait(WindowsFolder ^ "IsUninst.exe", " -f\"" + INSTALLDIR ^ "setup\\onwan\\uninst.log\" -c \"" + INSTALLDIR ^ "setup\\onwan\\zuninst.dll\"",LAAW_OPTION_WAIT)

this doesn't work; it also doesn't work when i wrote the whole string two the second parameter, like in the first use.

any idea??
thanks

DevinEllingson
10-24-2003, 10:47 PM
LAlexander,

The LAAW function adjusts the szProgram as follows before calling CreateProcess, most likely this is what is causing the problems. The next step would be to build the adjusted string and pass it via. szCmdLine to see if the updated command line works, and if not why.

Here is some code from LAAW:



// Adjust szProgram
LongPathFromShortPath(szProgram);
LongPathToQuote(szProgram, TRUE);

// Build the full command line.
szComplete = szProgram;

if( StrLengthChars( szComplete ) ) then
szComplete = szComplete + " ";
endif;

szComplete = szComplete + szCmdLine;


We then pass szComplete as the second param of CreateProcess.

Devin Ellingson
InstallShield Software Corporation