forked from akanyan/STARTLINER
feat: initial support for io pkgs
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::{anyhow, Result};
|
||||
use ini::Ini;
|
||||
use crate::{model::{config::Segatools, segatools_base::segatools_base}, profiles::ProfilePaths, util::{self, PathStr}};
|
||||
@ -59,7 +61,7 @@ impl Segatools {
|
||||
|
||||
if let Some(io) = &self.io {
|
||||
ini_out.with_section(Some("mu3io"))
|
||||
.set("path", util::pkg_dir().join(io.to_string()).join("mu3io.dll").stringify()?);
|
||||
.set("path", util::pkg_dir().join(io.to_string()).join("segatools").join("mu3io.dll").stringify()?);
|
||||
} else {
|
||||
ini_out.with_section(Some("mu3io"))
|
||||
.set("path", "");
|
||||
@ -78,8 +80,22 @@ impl Segatools {
|
||||
}
|
||||
}
|
||||
|
||||
if !exe_dir.join("DEVICE").join("ca.crt").exists() {
|
||||
util::copy_directory(
|
||||
util::pkg_dir().join(self.hook_dir()?).join("DEVICE"),
|
||||
exe_dir.join("DEVICE"),
|
||||
false
|
||||
)?;
|
||||
}
|
||||
|
||||
log::debug!("end line-up: segatools");
|
||||
|
||||
Ok(ini_out)
|
||||
}
|
||||
|
||||
pub fn hook_dir(&self) -> Result<PathBuf> {
|
||||
Ok(util::pkg_dir()
|
||||
.join(self.hook.as_ref().ok_or_else(|| anyhow!("No hook"))?.to_string())
|
||||
.join("segatools"))
|
||||
}
|
||||
}
|
@ -88,9 +88,7 @@ impl Profile for OngekiProfile {
|
||||
|
||||
let target_path = PathBuf::from(&self.sgt.target);
|
||||
let exe_dir = target_path.parent().ok_or_else(|| anyhow!("Invalid target path"))?;
|
||||
let sgt_dir = util::pkg_dir()
|
||||
.join(self.sgt.hook.as_ref().ok_or_else(|| anyhow!("No hook"))?.to_string())
|
||||
.join("segatools");
|
||||
let sgt_dir = self.sgt.hook_dir()?;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
|
Reference in New Issue
Block a user