This commit is contained in:
rustdesk 2024-02-26 19:01:42 +08:00
parent 2217e5303d
commit 6720bb9f6b

View File

@ -2,7 +2,7 @@ use super::{CursorData, ResultType};
use crate::common::PORTABLE_APPNAME_RUNTIME_ENV_KEY; use crate::common::PORTABLE_APPNAME_RUNTIME_ENV_KEY;
use crate::{ use crate::{
ipc, ipc,
license::*, custom_server::*,
privacy_mode::win_topmost_window::{self, WIN_TOPMOST_INJECTED_PROCESS_EXE}, privacy_mode::win_topmost_window::{self, WIN_TOPMOST_INJECTED_PROCESS_EXE},
}; };
use hbb_common::libc::{c_int, wchar_t}; use hbb_common::libc::{c_int, wchar_t};
@ -1468,13 +1468,13 @@ fn get_reg_of(subkey: &str, name: &str) -> String {
"".to_owned() "".to_owned()
} }
pub fn get_license_from_exe_name() -> ResultType<License> { pub fn get_license_from_exe_name() -> ResultType<CustomServer> {
let mut exe = std::env::current_exe()?.to_str().unwrap_or("").to_owned(); let mut exe = std::env::current_exe()?.to_str().unwrap_or("").to_owned();
// if defined portable appname entry, replace original executable name with it. // if defined portable appname entry, replace original executable name with it.
if let Ok(portable_exe) = std::env::var(PORTABLE_APPNAME_RUNTIME_ENV_KEY) { if let Ok(portable_exe) = std::env::var(PORTABLE_APPNAME_RUNTIME_ENV_KEY) {
exe = portable_exe; exe = portable_exe;
} }
get_license_from_string(&exe) get_custom_server_from_string(&exe)
} }
#[inline] #[inline]
@ -2509,8 +2509,8 @@ pub fn alloc_console() {
} }
} }
fn get_license() -> Option<License> { fn get_license() -> Option<CustomServer> {
let mut lic: License = Default::default(); let mut lic: CustomServer = Default::default();
if let Ok(tmp) = get_license_from_exe_name() { if let Ok(tmp) = get_license_from_exe_name() {
lic = tmp; lic = tmp;
} else { } else {