* Unregister bug, add firefox support for *nix client

This commit is contained in:
Heng Sin Low 2007-02-21 03:17:12 +00:00
parent d3d724bb10
commit ddebc8ac20
1 changed files with 23 additions and 3 deletions

View File

@ -46,6 +46,8 @@ public final class Env
/** Logging */ /** Logging */
private static CLogger s_log = CLogger.getCLogger(Env.class); private static CLogger s_log = CLogger.getCLogger(Env.class);
private static String UNIX_BROWSER = "netscape";
/** /**
* Exit System * Exit System
* @param status System exit status (usually 0 for no error) * @param status System exit status (usually 0 for no error)
@ -1335,10 +1337,27 @@ public final class Env
// OS command // OS command
String cmd = "rundll32 url.dll,FileProtocolHandler "; String cmd = "rundll32 url.dll,FileProtocolHandler ";
if (!isWindows()) if (!isWindows())
cmd = "netscape "; cmd = UNIX_BROWSER + " ";
// //
String execute = cmd + url; String execute = cmd + url;
try try
{
Runtime.getRuntime().exec(execute);
return;
}
catch (Exception e)
{
if (isWindows())
s_log.severe(execute + " - " + e);
}
//try firefox
if (!isWindows() && !("firefox".equals(UNIX_BROWSER)))
{
UNIX_BROWSER = "firefox";
cmd = UNIX_BROWSER + " ";
execute = cmd + url;
try
{ {
Runtime.getRuntime().exec(execute); Runtime.getRuntime().exec(execute);
} }
@ -1346,6 +1365,7 @@ public final class Env
{ {
s_log.severe(execute + " - " + e); s_log.severe(execute + " - " + e);
} }
}
} // startBrowser } // startBrowser
/** /**