mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-21 07:06:13 +00:00
fix default video save directory
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
1 parent
e94c3467eb
commit
150057f92d
9 files changed
+87
-32
No files matched your search
@@ -10,6 +10,7 @@ use std::io::prelude::*;
|
||||
use std::{
|
||||
ffi::{CString, OsString},
|
||||
fs, io, mem,
|
||||
path::PathBuf,
|
||||
sync::{Arc, Mutex},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
@@ -734,6 +735,18 @@ pub fn get_active_username() -> String {
|
||||
.to_owned()
|
||||
}
|
||||
|
||||
pub fn get_active_user_home() -> Option<PathBuf> {
|
||||
let username = get_active_username();
|
||||
if !username.is_empty() {
|
||||
let drive = std::env::var("SystemDrive").unwrap_or("C:".to_owned());
|
||||
let home = PathBuf::from(format!("{}\\Users\\{}", drive, username));
|
||||
if home.exists() {
|
||||
return Some(home);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn is_prelogin() -> bool {
|
||||
let username = get_active_username();
|
||||
username.is_empty() || username == "SYSTEM"
|
||||
|
||||
Reference in new issue
Block a user