Skip to content

Commit

Permalink
Merge pull request #19 from CarrotRub/dev-linux
Browse files Browse the repository at this point in the history
PRE v1.0.3 : Pull Request From Branch "dev-linux"
  • Loading branch information
CarrotRub authored Oct 6, 2024
2 parents 922468a + 36dfc33 commit 6451909
Show file tree
Hide file tree
Showing 21 changed files with 408 additions and 963 deletions.
718 changes: 15 additions & 703 deletions package-lock.json

Large diffs are not rendered by default.

51 changes: 49 additions & 2 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2021"
tauri-build = { version = "1.5.4", features = [] }

[dependencies]
tauri = { version = "1.7.2", features = ["api-all"] }
tauri = { version = "1.8.0", features = ["api-all"] }
serde = { version = "1.0.209", features = ["derive"] }
serde_json = "1.0.127"
reqwest = { version = "0.12.7", features = ["blocking", "rustls-tls"] }
Expand All @@ -26,21 +26,25 @@ librqbit = { git = "https://github.com/ikatson/rqbit", tag = "v7.1.0-beta.1" }
regex = "1.10.6"
thiserror = "1.0.63"
lazy_static = "1.5.0"
devtools = "0.3.3"
chrono = "0.4.38"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json", "ansi"] }
tracing = "0.1.40"
tracing-appender = "0.2.3"
select = "0.6"

[target.'cfg(windows)'.dependencies]
uiautomation = "0.12.2"
devtools = "0.3.3"
chrono = "0.4.38"
[dependencies.windows]
version = "0.58.0"
features = [
windows = { version = "0.58.0", features = [
"Win32_Foundation",
"Win32_UI_WindowsAndMessaging",
"Win32_UI_Controls",
"Win32_System_SystemInformation"
]
] }

[target.'cfg(unix)'.dependencies]
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }

[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]
5 changes: 5 additions & 0 deletions src-tauri/necessary_libs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# FOR ARCH LINUX/STEAMDECK OS BUILDS
## Install these libraries to dev or build yourself:
```
sudo pacman -S webkit2gtk libsoup
```
36 changes: 34 additions & 2 deletions src-tauri/src/custom_ui_automation.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

#[cfg(target_os = "windows")]
mod checklist_automation {
use uiautomation::{UIAutomation, UIElement};
use uiautomation::types::UIProperty::{ClassName, NativeWindowHandle, ToggleToggleState};
Expand All @@ -17,6 +19,7 @@ mod checklist_automation {
sec_elem
}

#[cfg(target_os = "windows")]
pub fn get_checkboxes_from_list(list_to_check: Vec<String>) {
let automation = UIAutomation::new().unwrap();
let walker = automation.get_control_view_walker().unwrap();
Expand Down Expand Up @@ -95,14 +98,15 @@ mod checklist_automation {




#[cfg(target_os = "windows")]
pub mod windows_ui_automation {
use std::process::Command;
use std::path::Path;
use std::{thread, time};
use super::checklist_automation;
use crate::mighty::windows_controls_processes;


pub async fn start_executable<P: AsRef<Path> + std::convert::AsRef<std::ffi::OsStr>>(path: P) {
match Command::new(path)
.spawn()
Expand All @@ -122,6 +126,7 @@ pub mod windows_ui_automation {
}
}

#[cfg(target_os = "windows")]
pub async fn automate_until_download(user_checkboxes_to_check: Vec<String>, path_to_game: &str, should_two_gb_limit: bool) {

// Skip Select Setup Language.
Expand Down Expand Up @@ -157,7 +162,8 @@ pub mod windows_ui_automation {
// Print and get and send progress bar value every 500ms
}

pub mod windows_custom_commands {
pub mod executable_custom_commands {
#[cfg(target_os = "windows")]
use std::process::Command;


Expand All @@ -168,6 +174,9 @@ pub mod windows_custom_commands {
/// Do not worry about using String, since the path will always be obtained by dialog through Tauri thus making it always corret for the OS.
#[tauri::command]
pub fn start_executable(path: String) {

// Here, use this **ONLY** for windows OS
#[cfg(target_os = "windows")]
match Command::new(&path)
.spawn()
{
Expand All @@ -182,7 +191,30 @@ pub mod windows_custom_commands {
}
},
}

#[cfg(target_os = "linux")]
// Add usage of wine + check beforehand with Flatpak if steamos
todo!()

}


}


pub mod linux_ui_automation {

/// This function will start an executable using Wine.
///
/// This function is specific to Arch Linux + X11
///
/// Note that this will work on SteamDeck OS 3.0
///
pub fn start_executable_arch_x11() {

// TODO: Ask for Wine to be installed either through the AUR or to be installed through Flatpak if a steamdeck is used
// TODO: Ask it through notification after launching the launcher.
todo!()
}

}
Loading

0 comments on commit 6451909

Please sign in to comment.