feat(launcher): native Windows support

Port the egui launcher to run natively on Windows (no Wine/Proton). The GUI,
launch state machine, config, health/account monitors, and openfut.cfg writing
are unchanged and cross-platform; only the effect layer is branched:

- game_launch: cfg(windows) launch spawns the game executable directly with its
  working dir (the version.dll hijack loads from the game dir; no WINEDLLOVERRIDES,
  Wine prefix, or licence regen). Requires the launcher to run elevated so the
  child inherits admin. Linux Proton path gated cfg(unix).
- arm: cfg(windows) is a no-op (routing is openfut.cfg, written by the client-files
  step; no ptrace_scope/DNAT/hosts). Linux arming gated cfg(unix).
- local_services: on Windows LSX/autopatch are in-process (stp-origin_emu.dll +
  version.dll hook), so ensure_running reports ready without spawning. Gated the
  unix-only CommandExt/process_group.
- preflight: cfg(windows) run() keeps only backend-reachable + hook-config checks.
- config: GameProfile configured()/validate() accept a runner-less Windows profile.

theme: fix a latent cross-platform panic — egui 0.29 keeps a Style per theme, so
set_style only reached the active one and TextStyle::resolve("Hero") panicked when
the other theme rendered. Install the full style into both themes and pin Dark.

Cross-built for x86_64-pc-windows-gnu; Linux build + 75 tests unchanged.
This commit is contained in:
funman300
2026-08-20 19:21:01 +00:00
parent 8d5bb6202a
commit 057cf92c3b
6 changed files with 158 additions and 23 deletions
+18
View File
@@ -22,6 +22,7 @@ use std::{
time::{Duration, Instant},
};
#[cfg(unix)]
use std::os::unix::process::CommandExt;
use crate::fifa17_capability::{
@@ -433,6 +434,21 @@ impl ServiceSupervisor {
/// Start `service` only if it is not already usable. Never restarts a healthy
/// service, and never adopts a foreign one as ours.
pub fn ensure_running(&mut self, service: Service, spec: SpawnSpec) -> Result<Ensured, String> {
// On native Windows the "companion services" are NOT separate processes:
// LSX/Origin login and the ProtoSSL cert path are provided in-process by
// stp-origin_emu.dll and the version.dll hook once the game runs. There is
// nothing for the launcher to spawn or supervise, so report ready.
#[cfg(windows)]
{
let _ = spec;
self.log.lock().push(format!(
"[launcher] {} is in-process on Windows (stp/hook) — nothing to start.",
service.label()
));
return Ok(Ensured::Reused);
}
#[cfg(unix)]
{
let runtime = self.observe(service);
if runtime.ready() {
self.log.lock().push(format!(
@@ -460,6 +476,7 @@ impl ServiceSupervisor {
.map_err(|e| e.to_string())?;
*self.slot(service) = ManagedService::from_child(child);
Ok(Ensured::Started)
}
}
/// Stop a service the launcher owns. A foreign process is reported, never
@@ -532,6 +549,7 @@ pub fn spawn(
cmd.env("OPENFUT_AUTOPATCH_LOG", log_path);
}
// Put each companion in its own process group for lifecycle isolation.
#[cfg(unix)]
cmd.process_group(0);
cmd.stdout(Stdio::piped()).stderr(Stdio::piped());