Run with wine if Pterodactyl, and run with proton if not.

This commit is contained in:
zontreck 2024-05-25 15:31:48 -07:00
parent e6736842e9
commit df83511e45

View file

@ -55,13 +55,18 @@ Future<void> runDetachedProton(
List<String> args = ["run", command];
args.addAll(argx);
StateMachine.PROC = await Process.start(
"xvfb-run",
["--auto-servernum", settings.getProtonExecutablePath()] +
args, // Run arbitrary command with arguments
environment: env,
workingDirectory: workingDir,
mode: ProcessStartMode.normal);
if (settings.inst!.pterodactylMode)
StateMachine.PROC = await Process.start("wine", args,
environment: env,
workingDirectory: workingDir,
mode: ProcessStartMode.normal);
else
StateMachine.PROC = await Process.start(
settings.getProtonExecutablePath(),
args, // Run arbitrary command with arguments
environment: env,
workingDirectory: workingDir,
mode: ProcessStartMode.normal);
StateMachine.monitorProcess();
} catch (e) {