Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Executing command after JBoss server is started ... (http://forums.winamp.com/showthread.php?t=250411)

nagaraju 5th July 2006 07:05

Executing command after JBoss server is started ...
 
Hi,
I am new to this forum. I have an issue with my nsis installer. During the install process i need to start JBoss application server and execute a command from command line. I was able to run JBoss using the command nsExec::ExecToLog but unable to execute the successive command as the the installer doesnt execute any further after starting JBoss server. Is there any way in running both the commands in two consecutive command line consoles as my first JBoss start console doesnt return to command prompt upon starting.

I have tried with various options like
ExecWait
nsExec::Exec
nsExec::ExecToStack and
system::call

Is there any way in which my issue could be resolved... ?
Thank you in advance.

Afrow UK 5th July 2006 10:08

Just use Exec. All the others that you have tried execute the executable and wait until it is finished.
Exec will run it and just carry on.

-Stu

nagaraju 5th July 2006 11:28

Thank you

Yurik 7th July 2006 16:45

I had similar issue with JBoss - my script should do something after JBoss stop. I decided to just look for server.log file. Maybe it will be useful for you:
code:

Function MainJBossClosingRoutine
Pop $JBossPath

StrCpy $JBossSubdir $JBossPath

; This will stop JBoss in case it is FULLY loaded.
; Exception will occur when it is loading, JBoss won't be stopped
SetOutPath "$JBossSubdir\bin"
nsExec::ExecToLog '"$JBossSubdir\bin\shutdown.bat" -S'

; Wait until JBoss is closed since it takes some time.
; The possible time is when server.log could be deleted.
StrCpy $1 0
${while} ${FileExists} "${JBossLogFile}"
; Try to delete it
Delete "${JBossLogFile}"
; ...and wait till it is deleted.
; The following algorithm is used:
; if log file exists, it means that
; JBoss is not shut down
; continuously check this file for 10 minutes.
; in case this file disappear - go on.
; in case in 10 minutes nothing happened, issue a message
; and continue.
; The latter situation may be caused by exceptions in
; shutdown batch.
IntOp $1 $1 + 1
${if} $1 <= 120 ; 2 minutes to close JBoss
Sleep 1000 ; one second
${else}
MessageBox MB_ICONEXCLAMATION|MB_OK "${CannotCloseJBoss}"
${endif}
${endwhile}
FunctionEnd


nagaraju 10th July 2006 04:59

Hi Yurik,
Thanks for your suggestion.
Anyways, i got my issue resolved using "start run" instead of "run" to start the JBoss server. This command opens the server in a separate command window than the existing. The issue is resolved.
Regards,
Nagaraju.


All times are GMT. The time now is 05:55.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.