Added patch so Mac version uses OpenNX Client instead NX Client.

This patch has been submited by Virginio from University of Murcia, and fixes the use of Linux Machines one newer MAC versions (Lion & Mountain Lion), that do not includes rosseta anymore, and can't execute NX client.
This commit is contained in:
Adolfo Gómez 2013-04-20 03:41:15 +00:00
parent d84d138cb0
commit 66461057ec
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ import java.util.UUID;
public class MacApplet implements OsApplet { public class MacApplet implements OsApplet {
private final String[] paths = { "/Applications/NX Client for OSX.app/Contents/MacOS/" }; private final String[] paths = { "/Applications/NX Client for OSX.app/Contents/MacOS/" };
private final String nxclient = "nxclient"; private final String app = "OpenNXapp";
private Hashtable<String,String> params; private Hashtable<String,String> params;
private String tmpDir = ""; private String tmpDir = "";
@ -67,17 +67,17 @@ public class MacApplet implements OsApplet {
for(int i = 0; i < paths.length; i++ ) for(int i = 0; i < paths.length; i++ )
{ {
File f = new File(paths[i] + nxclient); File f = new File(paths[i] + app);
if( f.exists() ) if( f.exists() )
{ {
execPath = paths[i] + nxclient; execPath = paths[i] + app;
break; break;
} }
} }
if( execPath.length() == 0 ) if( execPath.length() == 0 )
{ {
javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /Applications/NX Client for OSX.app/Contents/MacOS/\nPlease, install it"); javax.swing.JOptionPane.showMessageDialog(null, "Can't find OpenNXapp client.\nShould be at /Applications/NX Client for OSX.app/Contents/MacOS/\nPlease, install it");
System.err.println("Can't find nxclient."); System.err.println("Can't find nxclient.");
return; return;
} }
@ -100,7 +100,7 @@ public class MacApplet implements OsApplet {
private void executeTunnel(String nxCmd) throws IOException private void executeTunnel(String nxCmd) throws IOException
{ {
String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java";
String [] exec = { java, "-jar", jarFileName, tunPort, nxCmd, "--session", nxFileName }; String [] exec = { java, "-jar", jarFileName, tunPort, nxCmd, "--session", nxFileName, "--autologin", "--killerrors" };
ProcessBuilder pb = new ProcessBuilder( exec ); ProcessBuilder pb = new ProcessBuilder( exec );
Map<String,String> env = pb.environment(); Map<String,String> env = pb.environment();
env.put("TPARAMS", params.get("tun")); env.put("TPARAMS", params.get("tun"));