diff --git a/lib/consts.dart b/lib/consts.dart index ef4f748..c3e95c3 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,3 +1,3 @@ class Consts { - static const VERSION = "1.1.112524.1211"; + static const VERSION = "1.1.112524.1703"; } diff --git a/lib/pages/ModManager.dart b/lib/pages/ModManager.dart index 2e6a452..19ce691 100644 --- a/lib/pages/ModManager.dart +++ b/lib/pages/ModManager.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:servermanager/structs/discordHookHelper.dart'; import '../structs/mod.dart'; import '../structs/settings.dart'; diff --git a/lib/wine.dart b/lib/wine.dart index f3c960d..a137e50 100644 --- a/lib/wine.dart +++ b/lib/wine.dart @@ -13,6 +13,11 @@ 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()); @@ -29,14 +34,15 @@ Future runWine(String command, List argx) async { args.addAll(argx); ProcessResult? res; - if (requiredWine) + if (requiredWine) { res = await Process.run( "wine", args, // Run arbitrary command with arguments environment: env, ); - else + } else { res = await Process.run("cmd", ["/C"] + args, environment: {}); + } print('Exit code: ${res.exitCode}'); print('stdout: ${res.stdout}'); @@ -97,18 +103,18 @@ Future runDetachedWine( List args = [command]; args.addAll(argx); - if (requiredWine) + if (requiredWine) { StateMachine.PROC = await Process.start( "wine", args, // Run arbitrary command with arguments environment: env, workingDirectory: workingDir, mode: ProcessStartMode.detachedWithStdio); - else - StateMachine.PROC = await Process.start( - args[0], args.length > 1 ? args.sublist(1) : [], + } else { + StateMachine.PROC = await Process.start("cmd", ["/C"] + args, environment: {}, workingDirectory: workingDir, mode: ProcessStartMode.detachedWithStdio); + } try { StateMachine.PROC!.stdout.forEach((line) {}); diff --git a/pubspec.yaml b/pubspec.yaml index 98cbc81..70f0b9e 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+1211 +version: 1.1.112524+1703 environment: sdk: ">=3.1.4 <4.0.0"