Make some windows specific fixes
This commit is contained in:
parent
a3d263cd99
commit
2998f87f13
8 changed files with 44 additions and 19 deletions
|
@ -25,7 +25,7 @@ FROM git.zontreck.com/ariascreations/yolks:wine_8.0
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=BUILDER /app/out/server /app/server
|
||||
COPY --from=BUILDER /app/out/cemmserver /app/server
|
||||
COPY --from=RCONBUILD /app/mcrcon/mcrcon /app/rcon
|
||||
|
||||
|
||||
|
|
4
Jenkinsfile
vendored
4
Jenkinsfile
vendored
|
@ -69,9 +69,7 @@ pipeline {
|
|||
steps {
|
||||
script {
|
||||
bat 'flutter pub get'
|
||||
bat 'flutter build windows'
|
||||
bat 'mkdir out'
|
||||
bat 'dart compile exe -o out\\server.exe bin\\server.dart'
|
||||
bat 'call compile.bat'
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ void main() async {
|
|||
await settings.Read();
|
||||
|
||||
print(
|
||||
"Server Admin Credentials\nUsername: ${settings.superuser.name}\nPassword (Default): changeMe123\n\n");
|
||||
"Server Admin Credentials\n> Username: ${settings.superuser.name}\n> Password (Default): changeMe123\n\n");
|
||||
|
||||
PathHelper helper = PathHelper(pth: Directory.current.path);
|
||||
helper = helper.resolve("data").mkdir();
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
@echo off
|
||||
|
||||
call flutter pub get
|
||||
call flutter build windows
|
||||
mkdir out
|
||||
call dart compile exe -o out\cemmserver.exe bin\server.dart
|
|
@ -14,7 +14,7 @@ then
|
|||
fi
|
||||
|
||||
|
||||
dart compile exe -o out/server bin/server.dart
|
||||
dart compile exe -o out/cemmserver bin/server.dart
|
||||
rsync -a --progress -h --delete build/linux/x64/release/bundle/ out/client/
|
||||
|
||||
if [ -f RELEASE ]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
class Consts {
|
||||
static const VERSION = "1.1.112324.1959";
|
||||
static const VERSION = "1.1.112424.2344";
|
||||
}
|
||||
|
|
|
@ -4,7 +4,15 @@ import 'package:libac_dart/utils/IOTools.dart';
|
|||
import 'package:servermanager/statemachine.dart';
|
||||
import 'package:servermanager/structs/settings.dart';
|
||||
|
||||
// A patch to allow windows to run software using the below methods.
|
||||
Future<bool> requiresWine() async {
|
||||
if (Platform.isWindows) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> runWine(String command, List<String> argx) async {
|
||||
bool requiredWine = await requiresWine();
|
||||
|
||||
Settings settings = Settings();
|
||||
Directory dir = Directory(settings.getWinePrefixPath());
|
||||
|
||||
|
@ -20,11 +28,16 @@ Future<void> runWine(String command, List<String> argx) async {
|
|||
List<String> args = [command];
|
||||
args.addAll(argx);
|
||||
|
||||
ProcessResult res = await Process.run(
|
||||
"wine",
|
||||
args, // Run arbitrary command with arguments
|
||||
environment: env,
|
||||
);
|
||||
ProcessResult? res;
|
||||
if (requiredWine)
|
||||
res = await Process.run(
|
||||
"wine",
|
||||
args, // Run arbitrary command with arguments
|
||||
environment: env,
|
||||
);
|
||||
else
|
||||
res = await Process.run(args[0], args.length > 1 ? args.sublist(1) : [],
|
||||
environment: {});
|
||||
|
||||
print('Exit code: ${res.exitCode}');
|
||||
print('stdout: ${res.stdout}');
|
||||
|
@ -35,6 +48,8 @@ Future<void> runWine(String command, List<String> argx) async {
|
|||
}
|
||||
|
||||
Future<void> runWinetrick(String trick) async {
|
||||
if (!(await requiresWine())) return;
|
||||
|
||||
Settings settings = Settings();
|
||||
Directory dir = Directory(settings.getWinePrefixPath());
|
||||
|
||||
|
@ -65,6 +80,8 @@ Future<void> runWinetrick(String trick) async {
|
|||
|
||||
Future<void> runDetachedWine(
|
||||
String command, List<String> argx, String workingDir) async {
|
||||
bool requiredWine = await requiresWine();
|
||||
|
||||
Settings settings = Settings();
|
||||
Directory dir =
|
||||
Directory(PathHelper.builder(settings.base_path).resolve("pfx").build());
|
||||
|
@ -81,11 +98,18 @@ Future<void> runDetachedWine(
|
|||
List<String> args = [command];
|
||||
args.addAll(argx);
|
||||
|
||||
StateMachine.PROC = await Process.start(
|
||||
"wine", args, // Run arbitrary command with arguments
|
||||
environment: env,
|
||||
workingDirectory: workingDir,
|
||||
mode: ProcessStartMode.detachedWithStdio);
|
||||
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) : [],
|
||||
environment: {},
|
||||
workingDirectory: workingDir,
|
||||
mode: ProcessStartMode.detachedWithStdio);
|
||||
|
||||
try {
|
||||
StateMachine.PROC!.stdout.forEach((line) {});
|
||||
|
|
|
@ -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.112324+1959
|
||||
version: 1.1.112424+2344
|
||||
|
||||
environment:
|
||||
sdk: ">=3.1.4 <4.0.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue