Skip to content

Latest commit

 

History

243 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bottles-core

The application core for managing Bottles Next Wine and Proton environments.

bottles-core discovers and installs managed components, persists bottles, executes Windows programs through WineBridge, and provides checkpointed prefix mutation and snapshots through the default fvs feature.

Disable FVS when only conventional, directly mutable prefixes are needed:

[dependencies]
bottles-core = { version = "0.1", default-features = false }

Without fvs, snapshot APIs and Virgo storage are not compiled, and failed or cancelled addon recipes are not rolled back automatically.

Source | Issue tracker

Overview

The crate is centered around four types:

  • Bottles owns the download service and provides the addon and bottle managers.
  • Addons publishes live collections of runners and installable addons. Item values are snapshots; query the manager again after a publication.
  • BottleManager interns bottles by UUID. A Bottle is a shared handle whose current immutable BottleState can be read or watched.
  • Operation<T> represents long-running work with progress and cooperative cancellation.

Operations are lazy. Await them, call cancel().await, or spawn them and explicitly detach the task; dropping an operation abandons it.

Example

Add bottles-core and an async runtime to your application:

[dependencies]
bottles-core = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }

Open the library, inspect the current bottles, and stop its download service:

use bottles_core::{Bottles, Config};

#[tokio::main]
async fn main() -> Result<(), bottles_core::error::Error> {
    let bottles = Bottles::open(Config::default()).await?;

    for bottle in bottles.bottles().list() {
        let state = bottle.state()?;
        println!("{}\t{}", state.id(), state.name());
    }

    bottles.close().await
}

Getting help

Build the API documentation locally with cargo doc -p bottles-core --open. Report bugs through the issue tracker.

License

Licensed under the GNU General Public License, version 3.

About

The source code of the Next core library.

Resources

Stars

13 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages