diff --git a/winapps/src/freerdp.rs b/winapps/src/freerdp.rs index 00152e3..760b3e1 100644 --- a/winapps/src/freerdp.rs +++ b/winapps/src/freerdp.rs @@ -6,20 +6,34 @@ pub mod freerdp_back { pub struct Freerdp {} impl RemoteClient for Freerdp { - fn check_depends(&self, _config: Config) { + fn check_depends(&self, config: Config) { let mut xfreerdp = Command::new("xfreerdp"); xfreerdp.stdout(Stdio::null()); xfreerdp.args(["-h"]); xfreerdp .spawn() .expect("Freerdp execution failed! It needs to be installed!"); + println!("Freerdp found!"); println!("All dependencies found!"); + println!("Running explorer as test!"); + + self.run_app(config, "explorer"); + + println!("Test finished!"); } - fn run_app(&self, _config: Config, _app: &str) { - todo!() + fn run_app(&self, config: Config, _app: &str) { + let mut xfreerdp = Command::new("xfreerdp"); + xfreerdp.args([ + //"/app:".to_owned() + app, + "/d:".to_owned() + &config.rdp.domain, + "/u:".to_owned() + &config.rdp.username, + "/p:".to_owned() + &config.rdp.password, + "/v:".to_owned() + &config.rdp.host, + ]); + xfreerdp.spawn().expect("Freerdp execution failed!"); } } } diff --git a/winapps/src/lib.rs b/winapps/src/lib.rs index 9d17961..b3d268b 100644 --- a/winapps/src/lib.rs +++ b/winapps/src/lib.rs @@ -31,13 +31,13 @@ pub struct HostConfig { #[derive(new, Debug, Deserialize, Serialize)] pub struct RemoteConfig { - #[new(value = "\"RDPWindows\".to_string()")] + #[new(value = "\"127.0.0.1\".to_string()")] host: String, #[new(value = "\"WORKGROUP\".to_string()")] domain: String, - #[new(value = "\"RDPUser\".to_string()")] + #[new(value = "\"Quickemu\".to_string()")] username: String, - #[new(value = "\"RDPPass\".to_string()")] + #[new(value = "\"quickemu\".to_string()")] password: String, }