This commit is contained in:
2025-07-07 08:47:25 +02:00
78 changed files with 1215 additions and 906 deletions

12
src-tauri/Cargo.lock generated
View File

@@ -468,9 +468,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.27"
version = "1.2.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc"
checksum = "4ad45f4f74e4e20eaa392913b7b33a7091c87e59628f4dd27888205ad888843c"
dependencies = [
"shlex",
]
@@ -4071,9 +4071,9 @@ dependencies = [
[[package]]
name = "shared_child"
version = "1.1.0"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2778001df1384cf20b6dc5a5a90f48da35539885edaaefd887f8d744e939c0b"
checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7"
dependencies = [
"libc",
"sigchld",
@@ -5105,9 +5105,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.46.0"
version = "1.46.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1140bb80481756a8cbe10541f37433b459c5aa1e727b4c020fbfebdc25bf3ec4"
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
dependencies = [
"backtrace",
"bytes",

View File

@@ -27,16 +27,18 @@ tauri-plugin-sql = "2.3.0"
tauri-plugin-dialog = "2.3.0"
tauri-plugin-fs = "2.4.0"
hardware-id = "0.3.0"
winreg = "0.55.0"
tauri-plugin-cors-fetch = "4.1.0"
sysinfo = "0.35.2"
winapi = { version = "0.3", features = ["winuser"] }
reqwest = { version = "0.12.22", features = ["json", "stream"] }
md5 = "0.8.0"
tokio = { version = "1.46.0", features = ["full"] }
tokio = { version = "1.46.1", features = ["full"] }
open = "5.3.2"
windows-sys = "0.60.2"
[target.'cfg(windows)'.dependencies]
winreg = "0.55.0"
winapi = { version = "0.3", features = ["winuser"] }
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-single-instance = "2.3.0"

View File

@@ -2,9 +2,7 @@
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"windows": ["main"],
"permissions": [
"core:default",
"shell:allow-open",
@@ -19,60 +17,60 @@
"core:window:allow-show",
"fs:default",
{
"identifier": "fs:allow-write",
"identifier": "fs:allow-read",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-read",
"identifier": "fs:allow-write",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-exists",
"allow": [
{
"path": "$HOME/**/*"
}
]
},
{
"identifier": "fs:allow-write-file",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-read-file",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-write-file",
"allow": [
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-read-text-file",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
},
{
"identifier": "fs:allow-mkdir",
"allow": [
{
"path": "$HOME/**/*"
}
{ "path": "$HOME/.ezpplauncher" },
{ "path": "$HOME/.ezpplauncher/*" },
{ "path": "$HOME/.ezpplauncher/**/*" }
]
}
]
}
}

View File

@@ -63,8 +63,18 @@ pub fn valid_osu_folder(folder: String) -> bool {
return false;
}
#[cfg(not(windows))]
#[tauri::command]
pub fn find_osu_installation() -> Option<String> {
None
}
#[cfg(windows)]
#[tauri::command]
pub fn find_osu_installation() -> Option<String> {
use winreg::RegKey;
use winreg::enums::*;
let hklm_registry_paths = ["SOFTWARE\\Classes\\osu\\DefaultIcon"];
let hkcr_registry_paths = [
@@ -140,7 +150,7 @@ pub fn find_osu_installation() -> Option<String> {
}
}
}
return None;
None
}
#[tauri::command]

View File

@@ -1,6 +1,4 @@
use std::ffi::OsString;
use std::fs;
use std::os::windows::ffi::OsStringExt;
use std::path::Path;
use sysinfo::Pid;
@@ -178,12 +176,20 @@ pub fn get_osu_config<P: AsRef<Path>>(
return Some(config_map);
}
#[cfg(not(windows))]
pub fn get_window_title_by_pid(_pid: Pid) -> String {
"".to_string()
}
#[cfg(windows)]
pub fn get_window_title_by_pid(pid: Pid) -> String {
use std::sync::{Arc, Mutex};
use winapi::shared::windef::HWND;
use winapi::um::winuser::{
EnumWindows, GetWindowTextW, GetWindowThreadProcessId, IsWindowVisible,
};
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
extern "system" fn enum_windows_proc(
hwnd: HWND,

View File

@@ -36,4 +36,4 @@
"icons/icon.ico"
]
}
}
}