Updated wincompatlib to support new dxvk versions

This commit is contained in:
Observer KRypt0n_ 2023-01-27 23:37:51 +02:00
parent c654d16e9f
commit 0df6b6aed8
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
2 changed files with 15 additions and 25 deletions

View file

@ -14,7 +14,7 @@ dirs = "4.0.0"
serde = { version = "1.0", features = ["derive"], optional = true } serde = { version = "1.0", features = ["derive"], optional = true }
serde_json = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true }
wincompatlib = { version = "0.1.3", features = ["dxvk"], optional = true } wincompatlib = { version = "0.2.0", optional = true }
lazy_static = { version = "1.4.0", optional = true } lazy_static = { version = "1.4.0", optional = true }
md5 = { version = "0.7.0", optional = true } md5 = { version = "0.7.0", optional = true }

View file

@ -1,4 +1,3 @@
use std::process::Output;
use std::path::PathBuf; use std::path::PathBuf;
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
@ -42,30 +41,21 @@ impl Version {
folder.into().join(&self.name).exists() folder.into().join(&self.name).exists()
} }
/// Apply current dxvk to specified wine prefix /// Install current dxvk
/// pub fn install<T: Into<PathBuf>>(&self, dxvks_folder: T, wine: &Wine, params: InstallParams) -> std::io::Result<()> {
/// If `wine_info` is `None`, then default system binaries will tried to be used Dxvk::install(
pub fn apply<T: Into<PathBuf>>(&self, dxvks_folder: T, prefix_path: T, wine: Option<Wine>) -> anyhow::Result<Output> { wine,
let apply_path = dxvks_folder.into().join(&self.name).join("setup_dxvk.sh"); dxvks_folder.into().join(&self.name),
params
)
}
let (wine_path, wineserver_path, wineboot_path) = match wine { /// Uninstall current dxvk
Some(wine) => (wine.binary(), wine.wineserver(), wine.wineboot()), pub fn uninstall<T: Into<PathBuf>>(&self, wine: &Wine, params: InstallParams) -> std::io::Result<()> {
None => (PathBuf::from("wine64"), PathBuf::from("wineserver"), PathBuf::from("wineboot")) Dxvk::uninstall(
}; wine,
params
let result = Dxvk::install( )
apply_path,
prefix_path.into(),
wine_path.clone(),
wine_path,
wineboot_path,
wineserver_path
);
match result {
Ok(output) => Ok(output),
Err(err) => Err(err.into())
}
} }
} }