feat, install indirect display driver when installing the app

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-11-18 12:14:21 +08:00
parent c223d6a87d
commit 3f3bca753c
2 changed files with 9 additions and 0 deletions

View File

@ -203,6 +203,8 @@ pub fn core_main() -> Option<Vec<String>> {
} else if args[0] == "--install-cert" {
#[cfg(windows)]
hbb_common::allow_err!(crate::platform::windows::install_cert(&args[1]));
#[cfg(all(windows, feature = "virtual_display_driver"))]
hbb_common::allow_err!(crate::virtual_display_manager::install_update_driver());
return None;
} else if args[0] == "--uninstall-cert" {
#[cfg(windows)]

View File

@ -53,6 +53,13 @@ impl VirtualDisplayManager {
}
}
pub fn install_update_driver() -> ResultType<()> {
VIRTUAL_DISPLAY_MANAGER
.lock()
.unwrap()
.install_update_driver()
}
pub fn plug_in_headless() -> ResultType<()> {
let mut manager = VIRTUAL_DISPLAY_MANAGER.lock().unwrap();
manager.prepare_driver()?;