Remove cert file arg on installing cert
Signed-off-by: fufesou <shuanglongchen@yeah.ne>
This commit is contained in:
parent
2d456fd1fc
commit
bb7300a055
@ -201,13 +201,11 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
.ok();
|
||||
return None;
|
||||
} else if args[0] == "--install-cert" {
|
||||
if args.len() == 1 {
|
||||
log::error!("--install-cert must be called with cert file path");
|
||||
return None;
|
||||
}
|
||||
#[cfg(windows)]
|
||||
hbb_common::allow_err!(crate::platform::windows::install_cert(&args[1]));
|
||||
if args.len() > 2 && args[2] == "silent" {
|
||||
hbb_common::allow_err!(crate::platform::windows::install_cert(
|
||||
crate::platform::windows::DRIVER_CERT_FILE
|
||||
));
|
||||
if args.len() > 1 && args[1] == "silent" {
|
||||
return None;
|
||||
}
|
||||
#[cfg(all(windows, feature = "virtual_display_driver"))]
|
||||
@ -220,10 +218,12 @@ pub fn core_main() -> Option<Vec<String>> {
|
||||
hbb_common::allow_err!(crate::platform::windows::uninstall_cert());
|
||||
return None;
|
||||
} else if args[0] == "--install-idd" {
|
||||
// Install cert if cert file is provided (2rd arg).
|
||||
if args.len() == 2 {
|
||||
#[cfg(windows)]
|
||||
hbb_common::allow_err!(crate::platform::windows::install_cert(&args[1]));
|
||||
#[cfg(windows)]
|
||||
{
|
||||
// It's ok to install cert multiple times.
|
||||
hbb_common::allow_err!(crate::platform::windows::install_cert(
|
||||
crate::platform::windows::DRIVER_CERT_FILE
|
||||
));
|
||||
}
|
||||
#[cfg(all(windows, feature = "virtual_display_driver"))]
|
||||
if crate::virtual_display_manager::is_virtual_display_supported() {
|
||||
|
@ -63,6 +63,8 @@ use windows_service::{
|
||||
use winreg::enums::*;
|
||||
use winreg::RegKey;
|
||||
|
||||
pub const DRIVER_CERT_FILE: &str = "RustDeskIddDriver.cer";
|
||||
|
||||
pub fn get_cursor_pos() -> Option<(i32, i32)> {
|
||||
unsafe {
|
||||
#[allow(invalid_value)]
|
||||
@ -1029,7 +1031,7 @@ if exist \"{tmp_path}\\{app_name} Tray.lnk\" del /f /q \"{tmp_path}\\{app_name}
|
||||
let src_exe = std::env::current_exe()?.to_str().unwrap_or("").to_string();
|
||||
|
||||
let install_cert = if options.contains("driverCert") {
|
||||
let s = format!(r#""{}" --install-cert "RustDeskIddDriver.cer""#, src_exe);
|
||||
let s = format!(r#""{}" --install-cert"#, src_exe);
|
||||
if silent {
|
||||
format!("{} silent", s)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user