1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

Location of Windows folder was Harcoded previously. Now it is fixed (thanks to Virginio)

This commit is contained in:
Adolfo Gómez 2013-05-13 16:30:13 +00:00
parent 174106530c
commit 256de48f60

View File

@ -10,7 +10,7 @@ import es.virtualcable.rdp.util;
public class WindowsApplet implements OsApplet {
private static final String MSTSC_CMD = "c:\\windows\\system32\\mstsc.exe";
private static final String MSTSC_CMD_REL = "\\system32\\mstsc.exe";
private Hashtable<String,String> params;
private String scrWidth;
@ -108,6 +108,7 @@ public class WindowsApplet implements OsApplet {
private void executeTunnel() throws IOException
{
String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java.exe";
String MSTSC_CMD = System.getenv("SystemRoot") + MSTSC_CMD_REL;
String [] cmd = { java, "-jar", jarFileName, tunPort, MSTSC_CMD, rdpFileName };
ProcessBuilder pb = new ProcessBuilder( cmd );
Map<String,String> env = pb.environment();
@ -120,6 +121,7 @@ public class WindowsApplet implements OsApplet {
private void executeDirect() throws IOException
{
String MSTSC_CMD = System.getenv("SystemRoot") + MSTSC_CMD_REL;
Runtime.getRuntime().exec( MSTSC_CMD + " \"" + rdpFileName + "\"" );
}