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

Executing Java through installscript...Please Help


7 replies to this topic

shriraj

shriraj
  • Full Members
  • 11 posts

Posted 30 October 2007 - 08:40

Hi,
I am bit new to installscript. I need to execute java code using installscript. I m using installshield 2008 professional.
Right now i am using batch file to execute java class and using LaunchAppAndWait function, it works fine but, if there is an exception while running the class how will my installer know....

Please help sad.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 31 October 2007 - 10:03

I don't think you need to use a batch file. Why don't you just run the java exe directly from LaunchAppAndWait? Then you could get the exit code.

shriraj

shriraj
  • Full Members
  • 11 posts

Posted 31 October 2007 - 11:04

thanks stefan for your reply,
but can you please elaborate more on it. I mean can you just show a piece of code so that i can understand.

Edited by shriraj, 31 October 2007 - 11:09.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 31 October 2007 - 11:10

Please post the content of your bat file.

shriraj

shriraj
  • Full Members
  • 11 posts

Posted 31 October 2007 - 11:38

heres the content,
d:
javac FileCreation.java
java FileCreation userid password > file.log > error.log

i dint knew the way to handle exception thrown by the class so i m printing the log(error.log).
But if you can suggest any another way, please let me know.

and also i need to pass some arguments like userid and password, is there any way to do so, but one more problem is that the total argument i pass can exceed 255 characters which is the limit of string.

i hope u understood my problem sad.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 November 2007 - 11:01

All you might be able to do is get the exit code. If you want to log, continue to use the batch file.

shriraj

shriraj
  • Full Members
  • 11 posts

Posted 01 November 2007 - 11:41

There is no need for log files, that was just a workaround.
But m still stuck with passing arguments

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 November 2007 - 11:52

Something like this:
CODE

szProgram = "java.exe";
szCmdLine = "FileCreation userid password";

nResult = LaunchAppAndWait(szProgram, szCmdLine, LAAW_OPTION_WAIT);
if ( nResult < 0 ) then
   MessageBox("Unable to launch "+ szProgram +".", SEVERE);
endif;

nExitCode = LAAW_PARAMETERS.nLaunchResult;