Trait ObsBootstrap

Source
pub trait ObsBootstrap {
    // Required methods
    fn is_valid_installation() -> Result<bool>;
    fn is_update_available() -> Result<bool>;
}
Expand description

A trait for bootstrapping OBS Studio.

This trait provides functionality to download, extract, and set up OBS Studio for use with libobs-rs. It also handles updates to OBS when necessary.

If you want to use this bootstrapper to also install required OBS binaries at runtime, do the following:

  • Add a obs.dll file to your executable directory. This file will be replaced by the obs installer. Recommended to use is the a dll dummy (found here, make sure you use the correct OBS version) and rename it to obs.dll.
  • Call ObsRuntime::new() at the start of your application. Options must be configured. For more documentation look at the tauri example app. This will download the latest version of OBS and extract it in the executable directory.
  • If BootstrapStatus::RestartRequired is returned, call ObsContext::spawn_updater() to spawn the updater process.
  • Exit the application. The updater process will wait for the application to exit and rename the obs_new.dll file to obs.dll and restart your application with the same arguments as before.

Example project

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§