This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Running command in new window
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 25, 2010
05:11 PM
Running command in new window
HI All,
In my installation I need to start up the BEA Weblogic in a different window, however, I have tried using the command line and script/batch file commands with /K but it is not triggering a new window and have tried running the commands in an infinite loop within the installer (the option to wait until process is completed is ticked)
I have even tried creating a temporary batch file with the following and then executing the script/batch file action but still it does not work
cd C:\temp\
run.bat
where run.bat has the following commands in it
C:\windows\system32\cmd.exe /K C:\bea\user_projects\domains\test\bin\startWeblogic.cmd
Any advice would be appreciated
thank!
In my installation I need to start up the BEA Weblogic in a different window, however, I have tried using the command line and script/batch file commands with /K but it is not triggering a new window and have tried running the commands in an infinite loop within the installer (the option to wait until process is completed is ticked)
I have even tried creating a temporary batch file with the following and then executing the script/batch file action but still it does not work
cd C:\temp\
run.bat
where run.bat has the following commands in it
C:\windows\system32\cmd.exe /K C:\bea\user_projects\domains\test\bin\startWeblogic.cmd
Any advice would be appreciated
thank!
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 27, 2010
10:16 AM
I create a WLST .py file and execute
But if you want to keep it running, I wrote custom code which basically uses the ANT project and ExecTask with setSpawn(true) while launching the startWebLogic.cmd file. I don't know if it is the best way, but it works for me.
java weblogic.WLST startup.pyIn that py file, I have a timeout, so if it doesn't start after so long, it gives an exit code which I then look for. I then configure WL and shut it down.
But if you want to keep it running, I wrote custom code which basically uses the ANT project and ExecTask with setSpawn(true) while launching the startWebLogic.cmd file. I don't know if it is the best way, but it works for me.
public void install(InstallerProxy ip) throws InstallException
{
// Get IA variables
String domainDirName = ip.substitute("$WL_DOMAIN_DIR$");
//String domainName = ip.substitute("$WL_DOMAIN_NAME$");
String logFileName = domainDirName + "/adminserver.log";
boolean isWindows = ((System.getProperty("os.name").toLowerCase()).indexOf("win") > -1);
// Initialize Ant project
Project p = new Project();
p.init();
// Setup re-direct file and workinf dir
Variable envRedirectLog = new Variable();
envRedirectLog.setKey("WLS_REDIRECT_LOG");
envRedirectLog.setValue(logFileName);
File domainDir = new File(domainDirName);
ExecTask et = new ExecTask();
et.setProject(p);
et.setSpawn(true);
et.setDir(domainDir);
et.addEnv(envRedirectLog);
// Create Arguments to execute
Argument commandLine = et.createArg();
boolean resolveExecutable = false;
String executable = null;
String argValue = null;
if (isWindows)
{
resolveExecutable = true;
executable = "cmd.exe";
argValue = "/c " + domainDir.getAbsolutePath() + "\\startWebLogic.cmd";
}
else
{
resolveExecutable = false;
executable = "/bin/sh";
argValue = domainDir.getAbsolutePath() + "/startWebLogic.sh";
commandLine.setValue("-c");
}
et.setExecutable(executable);
et.setResolveExecutable(resolveExecutable);
commandLine.setValue(argValue);
et.execute();
// Sleep for linux startups or it goes too quickly
try
{
Thread.sleep(5000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 27, 2010
04:44 PM
Thanks heaps for that purcell!
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)