Skip to content

Commit

Permalink
feat, install indirect display driver when installing the app
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou committed Nov 18, 2023
1 parent c223d6a commit 3f3bca7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
7 changes: 7 additions & 0 deletions src/virtual_display_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down

0 comments on commit 3f3bca7

Please sign in to comment.