From 5d5d43ed067975d4e552e483dc229b5edfba2ef6 Mon Sep 17 00:00:00 2001 From: zontreck Date: Tue, 26 Nov 2024 01:55:23 -0700 Subject: [PATCH] Attempt again to fix windows launch --- lib/consts.dart | 2 +- lib/statemachine.dart | 3 +-- lib/wine.dart | 9 ++++----- pubspec.yaml | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index c3e95c3..b7bdb8c 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,3 +1,3 @@ class Consts { - static const VERSION = "1.1.112524.1703"; + static const VERSION = "1.1.112624.0154"; } diff --git a/lib/statemachine.dart b/lib/statemachine.dart index 264be0b..499a79e 100644 --- a/lib/statemachine.dart +++ b/lib/statemachine.dart @@ -167,8 +167,7 @@ class StateMachine { .build(); if (Platform.isWindows) { - PROC = await Process.start(executable, conanArgs, - workingDirectory: settings.getServerPath()); + runWindows(executable, conanArgs); } else { runDetachedWine(executable, conanArgs, settings.getServerPath()); } diff --git a/lib/wine.dart b/lib/wine.dart index a137e50..a9ddb7a 100644 --- a/lib/wine.dart +++ b/lib/wine.dart @@ -13,11 +13,6 @@ Future requiresWine() async { Future runWine(String command, List argx) async { bool requiredWine = await requiresWine(); - if (Platform.isWindows) { - await runDetachedWine(command, argx, Directory.current.path); - return; - } - Settings settings = Settings(); Directory dir = Directory(settings.getWinePrefixPath()); @@ -52,6 +47,10 @@ Future runWine(String command, List argx) async { } } +Future runWindows(String command, List args) async { + runDetachedWine(command, args, Settings.Instance.getServerPath()); +} + Future runWinetrick(String trick) async { if (!(await requiresWine())) return; diff --git a/pubspec.yaml b/pubspec.yaml index 70f0b9e..cc79c5c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.1.112524+1703 +version: 1.1.112624+0154 environment: sdk: ">=3.1.4 <4.0.0"