Compare commits

...

2 Commits

Author SHA1 Message Date
96df57ac54 chore: Add "Under Construction" page for community and news
Signed-off-by: quexeky <git@quexeky.dev>
2025-08-19 12:17:41 +10:00
8069616f2b feat: add umu executable finding (#122)
Signed-off-by: quexeky <git@quexeky.dev>
2025-08-19 10:52:24 +10:00
6 changed files with 75 additions and 17 deletions

View File

@ -0,0 +1,16 @@
<template>
<div class="mx-auto flex flex-col items-center gap-y-4 max-w-2xl py-32 sm:py-48 lg:py-56">
<div>
<Wordmark />
</div>
<div class="text-center">
<h1 class="text-balance text-4xl font-bold font-display tracking-tight text-zinc-100 sm:text-6xl">
Under construction
</h1>
<p class="mt-6 text-lg leading-8 text-zinc-400">
Yes, we know. We're working on it <a class="text-white" target="_blank"
href="https://github.com/Drop-OSS/drop-app/issues/52">here.</a>
</p>
</div>
</div>
</template>

16
main/pages/news/index.vue Normal file
View File

@ -0,0 +1,16 @@
<template>
<div class="mx-auto flex flex-col items-center gap-y-4 max-w-2xl py-32 sm:py-48 lg:py-56">
<div>
<Wordmark />
</div>
<div class="text-center">
<h1 class="text-balance text-4xl font-bold font-display tracking-tight text-zinc-100 sm:text-6xl">
Under construction
</h1>
<p class="mt-6 text-lg leading-8 text-zinc-400">
Yes, we know. We're working on it <a class="text-white" target="_blank"
href="https://github.com/Drop-OSS/drop-app/issues/52">here.</a>
</p>
</div>
</div>
</template>

View File

@ -172,7 +172,7 @@ pub fn download_game_bucket(
let raw_res = response.text().map_err(|e| {
ApplicationDownloadError::Communication(RemoteAccessError::FetchError(e.into()))
})?;
info!("{}", raw_res);
info!("{raw_res}");
if let Ok(err) = serde_json::from_str::<DropServerError>(&raw_res) {
return Err(ApplicationDownloadError::Communication(
RemoteAccessError::InvalidResponse(err),
@ -196,8 +196,7 @@ pub fn download_game_bucket(
let length = raw_length.parse::<usize>().unwrap_or(0);
let Some(drop) = bucket.drops.get(i) else {
warn!(
"invalid number of Content-Lengths recieved: {}, {}",
i, lengths
"invalid number of Content-Lengths recieved: {i}, {lengths}"
);
return Err(ApplicationDownloadError::DownloadError);
};

View File

@ -64,8 +64,7 @@ use serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::Write;
use std::panic::PanicHookInfo;
use std::path::Path;
use std::process::{Command, Stdio};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::sync::Arc;
use std::time::SystemTime;
@ -110,13 +109,7 @@ fn create_new_compat_info() -> Option<CompatInfo> {
#[cfg(target_os = "windows")]
return None;
let has_umu_installed = Command::new(UMU_LAUNCHER_EXECUTABLE)
.stdout(Stdio::null())
.spawn();
if let Err(umu_error) = &has_umu_installed {
warn!("disabling windows support with error: {umu_error}");
}
let has_umu_installed = has_umu_installed.is_ok();
let has_umu_installed = *UMU_LAUNCHER_EXECUTABLE == PathBuf::new();
Some(CompatInfo {
umu_installed: has_umu_installed,
})

View File

@ -1,3 +1,10 @@
use std::{
ffi::OsStr,
path::PathBuf,
process::{Command, Stdio},
sync::LazyLock,
};
use log::debug;
use crate::{
@ -24,7 +31,31 @@ impl ProcessHandler for NativeGameLauncher {
}
}
pub const UMU_LAUNCHER_EXECUTABLE: &str = "umu-run";
pub static UMU_LAUNCHER_EXECUTABLE: LazyLock<PathBuf> = LazyLock::new(|| {
let x = get_umu_executable();
println!("{:?}", &x);
x
});
const UMU_BASE_LAUNCHER_EXECUTABLE: &str = "umu-run";
const UMU_INSTALL_DIRS: [&str; 4] = ["/app/share", "/use/local/share", "/usr/share", "/opt"];
fn get_umu_executable() -> PathBuf {
if check_executable_exists(UMU_BASE_LAUNCHER_EXECUTABLE) {
return PathBuf::from(UMU_BASE_LAUNCHER_EXECUTABLE);
}
for dir in UMU_INSTALL_DIRS {
let p = PathBuf::from(dir).join(UMU_BASE_LAUNCHER_EXECUTABLE);
if check_executable_exists(&p) {
return p;
}
}
PathBuf::new()
}
fn check_executable_exists<P: AsRef<OsStr>>(exec: P) -> bool {
let has_umu_installed = Command::new(exec).stdout(Stdio::null()).spawn();
has_umu_installed.is_ok()
}
pub struct UMULauncher;
impl ProcessHandler for UMULauncher {
fn create_launch_process(
@ -47,8 +78,8 @@ impl ProcessHandler for UMULauncher {
None => game_version.game_id.clone(),
};
format!(
"GAMEID={game_id} {umu} \"{launch}\" {args}",
umu = UMU_LAUNCHER_EXECUTABLE,
"GAMEID={game_id} {umu:?} \"{launch}\" {args}",
umu = &*UMU_LAUNCHER_EXECUTABLE,
launch = launch_command,
args = args.join(" ")
)
@ -80,7 +111,10 @@ impl ProcessHandler for AsahiMuvmLauncher {
game_version,
current_dir,
);
let mut args_cmd = umu_string.split("umu-run").collect::<Vec<&str>>().into_iter();
let mut args_cmd = umu_string
.split("umu-run")
.collect::<Vec<&str>>()
.into_iter();
let args = args_cmd.next().unwrap().trim();
let cmd = format!("umu-run{}", args_cmd.next().unwrap());

View File

@ -130,7 +130,7 @@ pub fn auth_initiate_code(app: AppHandle) -> Result<String, RemoteAccessError> {
let code = auth_initiate_logic("code".to_string())?;
let header_code = code.clone();
println!("using code: {} to sign in", code);
println!("using code: {code} to sign in");
tauri::async_runtime::spawn(async move {
let load = async || -> Result<(), RemoteAccessError> {