Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

LaunchAppAndWait


2 replies to this topic

ramalaks

ramalaks
  • Members
  • 19 posts

Posted 08 February 2006 - 19:28

I am calling a LaunchAppAndWait as shown below

chdir = TARGETDIR ^ "\\MySQL\\bin";
ChangeDirectory (chdir);
svpline = "/c " + TARGETDIR+"\\MySQL\\bin\\" + "mysql -u root -e \"source " + TARGETDIR + "\\MySQL\\bin\\DBInit.sql\"";
SprintfBox(WARNING, "running svpcmd cmd.exe %s",svpcmd);
if (LaunchAppAndWait("cmd.exe", svpline, LAAW_OPTION_WAIT|LAAW_OPTION_NO_CHANGEDIRECTORY|LAAW_OPTION_HIDDEN) < 0) then
SprintfBox(WARNING,"Failed to run dbinit.sql %s", svpcmd);
endif;


it does not work always. when i ran the setup.exe once it worked. I had to make more changes setup.rul and build it again. when trying again it does not work. seems LaunchAppAndWait does not wait ...

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 09 February 2006 - 08:56

Youo may end up with duplicate backslashes in svpline. Why don't you use chdir instead of TARGETDIR+"\\MySQL\\bin\\" ? Also I don't think this will work properly if TARGETDIR contains blanks. You'll need to quote (LongPathToQuote) it or convert it to short path.

nrlaing

nrlaing
  • Full Members
  • 14 posts

Posted 19 September 2008 - 21:02

I've found that there's a limit to how long your command line parameter can be. How long? Not sure. I ended up creating a .bat file launcher for any launchappandwait function call. Perform a text replace on a batch file that will do the job of your LaunchAppAndWait function, then call LaunchAppAndWait on that batch file. Pain? Yes.