mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-03-15 06:28:27 +03:00
Fixed ability to use system wine to run the game
This commit is contained in:
parent
f66624d40d
commit
c1af50b8c1
2 changed files with 9 additions and 7 deletions
|
@ -43,15 +43,13 @@ impl LauncherState {
|
|||
pub fn get<T: Fn(&str)>(status: T) -> std::io::Result<Self> {
|
||||
let config = config::get()?;
|
||||
|
||||
// Check wine existance
|
||||
if config.game.wine.selected == None {
|
||||
// Check wine existence
|
||||
if let None = config.try_get_wine_executable() {
|
||||
return Ok(Self::WineNotInstalled);
|
||||
}
|
||||
|
||||
// Check prefix existance
|
||||
let prefix = WinePrefix::new(&config.game.wine.prefix);
|
||||
|
||||
if !prefix.exists() {
|
||||
// Check prefix existence
|
||||
if !WinePrefix::exists_in(&config.game.wine.prefix) {
|
||||
return Ok(Self::PrefixNotExists);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,11 @@ impl WinePrefix {
|
|||
}
|
||||
|
||||
pub fn exists(&self) -> bool {
|
||||
Path::new(&format!("{}/drive_c", self.path)).exists()
|
||||
Self::exists_in(&self.path)
|
||||
}
|
||||
|
||||
pub fn exists_in<T: ToString>(path: T) -> bool {
|
||||
Path::new(&format!("{}/drive_c", path.to_string())).exists()
|
||||
}
|
||||
|
||||
fn wine<T: ToString>(&self, runners_folder: T, runner: super::wine::Version, command: &str) -> std::io::Result<Output> {
|
||||
|
|
Loading…
Add table
Reference in a new issue