mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-13 11:12:23 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62dae468bf | ||
|
|
a9af28273a | ||
|
|
232bf8fbfc | ||
|
|
a787c4efc9 | ||
|
|
4c3fe9bc65 | ||
|
|
3f88d5ed80 | ||
|
|
582270849e | ||
|
|
1ef4e76768 | ||
|
|
cd8c8e6dd9 | ||
|
|
170a878e79 | ||
|
|
a2505011d9 | ||
|
|
3e2c2e96b1 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
backend/**/* linguist-vendored
|
||||
@@ -8,6 +8,8 @@ Join our discord at https://discord.gg/reboot
|
||||
- COMMON: Shared business logic for CLI and GUI modules
|
||||
- CLI: Work in progress command line interface to host a Fortnite Server on a Windows VPS easily, developed in Dart
|
||||
- GUI: Stable graphical user interface to play and host Fortnite S0-14
|
||||

|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
2
backend/index.js
vendored
2
backend/index.js
vendored
@@ -35,7 +35,7 @@ express.use(require("./structure/matchmaking.js"));
|
||||
express.use(require("./structure/cloudstorage.js"));
|
||||
express.use(require("./structure/mcp.js"));
|
||||
|
||||
const port = process.env.PORT || 3551;
|
||||
const port = 3551;
|
||||
express.listen(port, () => {
|
||||
console.log("LawinServer started listening on port", port);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Future<bool> startServerCli(String? host, int? port, ServerType type) async {
|
||||
stdout.writeln("Starting backend server...");
|
||||
switch(type){
|
||||
case ServerType.local:
|
||||
var result = await pingBackend(host ?? kDefaultBackendHost, port ?? kDefaultBackendPort);
|
||||
final result = await pingBackend(host ?? kDefaultBackendHost, port ?? kDefaultBackendPort);
|
||||
if(result == null){
|
||||
throw Exception("Local backend server is not running");
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ const List<String> kCorruptedBuildErrors = [
|
||||
"Critical error",
|
||||
"when 0 bytes remain",
|
||||
"Pak chunk signature verification failed!",
|
||||
"Couldn't find pak signature file"
|
||||
"LogWindows:Error: Fatal error!"
|
||||
];
|
||||
const List<String> kCannotConnectErrors = [
|
||||
"port 3551 failed: Connection refused",
|
||||
|
||||
@@ -9,9 +9,22 @@ extension FortniteVersionExtension on FortniteVersion {
|
||||
|
||||
static File? findFile(Directory directory, String name) {
|
||||
try{
|
||||
final result = directory.listSync(recursive: true)
|
||||
.firstWhere((element) => path.basename(element.path) == name);
|
||||
return File(result.path);
|
||||
for(final child in directory.listSync()) {
|
||||
if(child is Directory) {
|
||||
if(!path.basename(child.path).startsWith("\.")) {
|
||||
final result = findFile(child, name);
|
||||
if(result != null) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}else if(child is File) {
|
||||
if(path.basename(child.path) == name) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}catch(_){
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,7 @@ enum ServerResultType {
|
||||
freePortError,
|
||||
pingingRemote,
|
||||
pingingLocal,
|
||||
pingError,
|
||||
processError;
|
||||
pingError;
|
||||
|
||||
bool get isError => name.contains("Error");
|
||||
|
||||
|
||||
@@ -15,10 +15,19 @@ final Semaphore _semaphore = Semaphore();
|
||||
String? _lastIp;
|
||||
String? _lastPort;
|
||||
|
||||
Future<Process> startEmbeddedBackend(bool detached) async => startProcess(
|
||||
Future<Process> startEmbeddedBackend(bool detached, {void Function(String)? onError}) async {
|
||||
final process = await startProcess(
|
||||
executable: backendStartExecutable,
|
||||
window: detached,
|
||||
);
|
||||
);
|
||||
process.stdOutput.listen((message) => log("[BACKEND] Message: $message"));
|
||||
process.stdError.listen((error) {
|
||||
log("[BACKEND] Error: $error");
|
||||
onError?.call(error);
|
||||
});
|
||||
process.exitCode.then((exitCode) => log("[BACKEND] Exit code: $exitCode"));
|
||||
return process;
|
||||
}
|
||||
|
||||
Future<HttpServer> startRemoteBackendProxy(Uri uri) async => await serve(proxyHandler(uri), kDefaultBackendHost, kDefaultBackendPort);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ final File launcherLogFile = _createLoggingFile();
|
||||
final Semaphore _semaphore = Semaphore(1);
|
||||
|
||||
File _createLoggingFile() {
|
||||
final file = File("${logsDirectory.path}\\launcher.log");
|
||||
final file = File("${installationDirectory.path}\\launcher.log");
|
||||
file.parent.createSync(recursive: true);
|
||||
if(file.existsSync()) {
|
||||
file.deleteSync();
|
||||
|
||||
@@ -14,9 +14,6 @@ Directory get assetsDirectory {
|
||||
return installationDirectory;
|
||||
}
|
||||
|
||||
Directory get logsDirectory =>
|
||||
Directory("${installationDirectory.path}\\logs");
|
||||
|
||||
Directory get settingsDirectory =>
|
||||
Directory("${installationDirectory.path}\\settings");
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// ignore_for_file: non_constant_identifier_names
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
@@ -9,6 +10,7 @@ import 'dart:math';
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_common/src/util/log.dart';
|
||||
import 'package:sync/semaphore.dart';
|
||||
import 'package:win32/win32.dart';
|
||||
|
||||
@@ -100,58 +102,49 @@ Future<bool> startElevatedProcess({required String executable, required String a
|
||||
shellInput.ref.fMask = ES_AWAYMODE_REQUIRED;
|
||||
shellInput.ref.lpVerb = "runas".toNativeUtf16();
|
||||
shellInput.ref.cbSize = sizeOf<SHELLEXECUTEINFO>();
|
||||
var shellResult = ShellExecuteEx(shellInput);
|
||||
return shellResult == 1;
|
||||
return ShellExecuteEx(shellInput) == 1;
|
||||
}
|
||||
|
||||
Future<Process> startProcess({required File executable, List<String>? args, bool useTempBatch = true, bool window = false, String? name, Map<String, String>? environment}) async {
|
||||
log("[PROCESS] Starting process on ${executable.path} with $args (useTempBatch: $useTempBatch, window: $window, name: $name, environment: $environment)");
|
||||
final argsOrEmpty = args ?? [];
|
||||
final workingDirectory = _getWorkingDirectory(executable);
|
||||
if(useTempBatch) {
|
||||
final tempScriptDirectory = await tempDirectory.createTemp("reboot_launcher_process");
|
||||
final tempScriptFile = File("${tempScriptDirectory.path}/process.bat");
|
||||
final tempScriptFile = File("${tempScriptDirectory.path}\\process.bat");
|
||||
final command = window ? 'cmd.exe /k ""${executable.path}" ${argsOrEmpty.join(" ")}"' : '"${executable.path}" ${argsOrEmpty.join(" ")}';
|
||||
await tempScriptFile.writeAsString(command, flush: true);
|
||||
final process = await Process.start(
|
||||
tempScriptFile.path,
|
||||
[],
|
||||
workingDirectory: executable.parent.path,
|
||||
workingDirectory: workingDirectory,
|
||||
environment: environment,
|
||||
mode: window ? ProcessStartMode.detachedWithStdio : ProcessStartMode.normal,
|
||||
runInShell: window
|
||||
);
|
||||
return _withLogger(name, executable, process, window);
|
||||
return _ExtendedProcess(process, true);
|
||||
}
|
||||
|
||||
final process = await Process.start(
|
||||
executable.path,
|
||||
args ?? [],
|
||||
workingDirectory: executable.parent.path,
|
||||
workingDirectory: workingDirectory,
|
||||
mode: window ? ProcessStartMode.detachedWithStdio : ProcessStartMode.normal,
|
||||
runInShell: window
|
||||
);
|
||||
return _withLogger(name, executable, process, window);
|
||||
return _ExtendedProcess(process, true);
|
||||
}
|
||||
|
||||
_ExtendedProcess _withLogger(String? name, File executable, Process process, bool window) {
|
||||
final extendedProcess = _ExtendedProcess(process, true);
|
||||
final loggingFile = File("${logsDirectory.path}\\${name ?? path.basenameWithoutExtension(executable.path)}-${DateTime.now().millisecondsSinceEpoch}.log");
|
||||
loggingFile.parent.createSync(recursive: true);
|
||||
if(loggingFile.existsSync()) {
|
||||
loggingFile.deleteSync();
|
||||
String? _getWorkingDirectory(File executable) {
|
||||
try {
|
||||
log("[PROCESS] Calculating working directory for $executable");
|
||||
final workingDirectory = executable.parent.resolveSymbolicLinksSync();
|
||||
log("[PROCESS] Using working directory: $workingDirectory");
|
||||
return workingDirectory;
|
||||
}catch(error) {
|
||||
log("[PROCESS] Cannot infer working directory: $error");
|
||||
return null;
|
||||
}
|
||||
|
||||
final semaphore = Semaphore(1);
|
||||
void logEvent(String event) async {
|
||||
await semaphore.acquire();
|
||||
await loggingFile.writeAsString("$event\n", mode: FileMode.append, flush: true);
|
||||
semaphore.release();
|
||||
}
|
||||
extendedProcess.stdOutput.listen(logEvent);
|
||||
extendedProcess.stdError.listen(logEvent);
|
||||
if(!window) {
|
||||
extendedProcess.exitCode.then((value) => logEvent("Process terminated with exit code: $value\n"));
|
||||
}
|
||||
return extendedProcess;
|
||||
}
|
||||
|
||||
final _NtResumeProcess = _ntdll.lookupFunction<Int32 Function(IntPtr hWnd),
|
||||
@@ -203,47 +196,61 @@ Future<bool> watchProcess(int pid) async {
|
||||
return await completer.future;
|
||||
}
|
||||
|
||||
// TODO: Template
|
||||
List<String> createRebootArgs(String username, String password, bool host, GameServerType hostType, bool log, String additionalArgs) {
|
||||
List<String> createRebootArgs(String username, String password, bool host, GameServerType hostType, bool logging, String additionalArgs) {
|
||||
log("[PROCESS] Generating reboot args");
|
||||
if(password.isEmpty) {
|
||||
username = '${_parseUsername(username, host)}@projectreboot.dev';
|
||||
}
|
||||
|
||||
password = password.isNotEmpty ? password : "Rebooted";
|
||||
final args = [
|
||||
"-epicapp=Fortnite",
|
||||
"-epicenv=Prod",
|
||||
"-epiclocale=en-us",
|
||||
"-epicportal",
|
||||
"-skippatchcheck",
|
||||
"-nobe",
|
||||
"-fromfl=eac",
|
||||
"-fltoken=3db3ba5dcbd2e16703f3978d",
|
||||
"-caldera=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiYmU5ZGE1YzJmYmVhNDQwN2IyZjQwZWJhYWQ4NTlhZDQiLCJnZW5lcmF0ZWQiOjE2Mzg3MTcyNzgsImNhbGRlcmFHdWlkIjoiMzgxMGI4NjMtMmE2NS00NDU3LTliNTgtNGRhYjNiNDgyYTg2IiwiYWNQcm92aWRlciI6IkVhc3lBbnRpQ2hlYXQiLCJub3RlcyI6IiIsImZhbGxiYWNrIjpmYWxzZX0.VAWQB67RTxhiWOxx7DBjnzDnXyyEnX7OljJm-j2d88G_WgwQ9wrE6lwMEHZHjBd1ISJdUO1UVUqkfLdU5nofBQ",
|
||||
"-AUTH_LOGIN=$username",
|
||||
"-AUTH_PASSWORD=${password.isNotEmpty ? password : "Rebooted"}",
|
||||
"-AUTH_TYPE=epic"
|
||||
];
|
||||
final args = LinkedHashMap<String, String>(
|
||||
equals: (a, b) => a.toUpperCase() == b.toUpperCase(),
|
||||
hashCode: (a) => a.toUpperCase().hashCode
|
||||
);
|
||||
args.addAll({
|
||||
"-epicapp": "Fortnite",
|
||||
"-epicenv": "Prod",
|
||||
"-epiclocale": "en-us",
|
||||
"-epicportal": "",
|
||||
"-skippatchcheck": "",
|
||||
"-nobe": "",
|
||||
"-fromfl": "eac",
|
||||
"-fltoken": "3db3ba5dcbd2e16703f3978d",
|
||||
"-caldera": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2NvdW50X2lkIjoiYmU5ZGE1YzJmYmVhNDQwN2IyZjQwZWJhYWQ4NTlhZDQiLCJnZW5lcmF0ZWQiOjE2Mzg3MTcyNzgsImNhbGRlcmFHdWlkIjoiMzgxMGI4NjMtMmE2NS00NDU3LTliNTgtNGRhYjNiNDgyYTg2IiwiYWNQcm92aWRlciI6IkVhc3lBbnRpQ2hlYXQiLCJub3RlcyI6IiIsImZhbGxiYWNrIjpmYWxzZX0.VAWQB67RTxhiWOxx7DBjnzDnXyyEnX7OljJm-j2d88G_WgwQ9wrE6lwMEHZHjBd1ISJdUO1UVUqkfLdU5nofBQ",
|
||||
"-AUTH_LOGIN": username,
|
||||
"-AUTH_PASSWORD": password.isNotEmpty ? password : "Rebooted",
|
||||
"-AUTH_TYPE": "epic"
|
||||
});
|
||||
|
||||
if(log) {
|
||||
args.add("-log");
|
||||
if(logging) {
|
||||
args["-log"] = "";
|
||||
}
|
||||
|
||||
if(host) {
|
||||
args.addAll([
|
||||
"-nosplash",
|
||||
"-nosound"
|
||||
]);
|
||||
args["-nosplash"] = "";
|
||||
args["-nosound"] = "";
|
||||
if(hostType == GameServerType.headless){
|
||||
args.add("-nullrhi");
|
||||
args["-nullrhi"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
if(additionalArgs.isNotEmpty){
|
||||
args.addAll(additionalArgs.split(" "));
|
||||
log("[PROCESS] Default args: $args");
|
||||
log("[PROCESS] Adding custom args: $additionalArgs");
|
||||
for(final additionalArg in additionalArgs.split(" ")) {
|
||||
log("[PROCESS] Processing custom arg: $additionalArg");
|
||||
final separatorIndex = additionalArg.indexOf("=");
|
||||
final argName = separatorIndex == -1 ? additionalArg : additionalArg.substring(0, separatorIndex);
|
||||
log("[PROCESS] Custom arg key: $argName");
|
||||
final argValue = separatorIndex == -1 || separatorIndex + 1 >= additionalArg.length ? "" : additionalArg.substring(separatorIndex + 1);
|
||||
log("[PROCESS] Custom arg value: $argValue");
|
||||
args[argName] = argValue;
|
||||
log("[PROCESS] Updated args: $args");
|
||||
}
|
||||
|
||||
return args;
|
||||
log("[PROCESS] Final args result: $args");
|
||||
return args.entries
|
||||
.map((entry) => entry.value.isEmpty ? entry.key : "${entry.key}=${entry.value}")
|
||||
.toList();
|
||||
}
|
||||
|
||||
void handleGameOutput({
|
||||
@@ -257,16 +264,22 @@ void handleGameOutput({
|
||||
required void Function() onBuildCorrupted,
|
||||
}) {
|
||||
if (line.contains(kShutdownLine)) {
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected shutdown: $line");
|
||||
onShutdown();
|
||||
}else if(kCorruptedBuildErrors.any((element) => line.contains(element))){
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected corrupt build: $line");
|
||||
onBuildCorrupted();
|
||||
}else if(kCannotConnectErrors.any((element) => line.contains(element))){
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected cannot connect error: $line");
|
||||
onTokenError();
|
||||
}else if(kLoggedInLines.every((entry) => line.contains(entry))) {
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected logged in: $line");
|
||||
onLoggedIn();
|
||||
}else if(line.contains(kGameFinishedLine) && host) {
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected match end: $line");
|
||||
onMatchEnd();
|
||||
}else if(line.contains(kDisplayInitializedLine) && host) {
|
||||
log("[FORTNITE_OUTPUT_HANDLER] Detected display attach: $line");
|
||||
onDisplayAttached();
|
||||
}
|
||||
}
|
||||
@@ -299,7 +312,14 @@ final class _ExtendedProcess implements Process {
|
||||
|
||||
|
||||
@override
|
||||
Future<int> get exitCode => _delegate.exitCode;
|
||||
Future<int> get exitCode {
|
||||
try {
|
||||
return _delegate.exitCode;
|
||||
}catch(_) {
|
||||
return watchProcess(_delegate.pid)
|
||||
.then((_) => -1);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool kill([ProcessSignal signal = ProcessSignal.sigterm]) => _delegate.kill(signal);
|
||||
|
||||
Binary file not shown.
@@ -1,735 +0,0 @@
|
||||
[Code]
|
||||
// https://github.com/DomGries/InnoDependencyInstaller
|
||||
|
||||
// types and variables
|
||||
type
|
||||
TDependency_Entry = record
|
||||
Filename: String;
|
||||
Parameters: String;
|
||||
Title: String;
|
||||
URL: String;
|
||||
Checksum: String;
|
||||
ForceSuccess: Boolean;
|
||||
RestartAfter: Boolean;
|
||||
end;
|
||||
|
||||
var
|
||||
Dependency_Memo: String;
|
||||
Dependency_List: array of TDependency_Entry;
|
||||
Dependency_NeedToRestart, Dependency_ForceX86: Boolean;
|
||||
Dependency_DownloadPage: TDownloadWizardPage;
|
||||
|
||||
procedure Dependency_Add(const Filename, Parameters, Title, URL, Checksum: String; const ForceSuccess, RestartAfter: Boolean);
|
||||
var
|
||||
Dependency: TDependency_Entry;
|
||||
DependencyCount: Integer;
|
||||
begin
|
||||
Dependency_Memo := Dependency_Memo + #13#10 + '%1' + Title;
|
||||
|
||||
Dependency.Filename := Filename;
|
||||
Dependency.Parameters := Parameters;
|
||||
Dependency.Title := Title;
|
||||
|
||||
if FileExists(ExpandConstant('{tmp}{\}') + Filename) then begin
|
||||
Dependency.URL := '';
|
||||
end else begin
|
||||
Dependency.URL := URL;
|
||||
end;
|
||||
|
||||
Dependency.Checksum := Checksum;
|
||||
Dependency.ForceSuccess := ForceSuccess;
|
||||
Dependency.RestartAfter := RestartAfter;
|
||||
|
||||
DependencyCount := GetArrayLength(Dependency_List);
|
||||
SetArrayLength(Dependency_List, DependencyCount + 1);
|
||||
Dependency_List[DependencyCount] := Dependency;
|
||||
end;
|
||||
|
||||
<event('InitializeWizard')>
|
||||
procedure Dependency_InitializeWizard;
|
||||
begin
|
||||
Dependency_DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil);
|
||||
end;
|
||||
|
||||
<event('PrepareToInstall')>
|
||||
function Dependency_PrepareToInstall(var NeedsRestart: Boolean): String;
|
||||
var
|
||||
DependencyCount, DependencyIndex, ResultCode: Integer;
|
||||
Retry: Boolean;
|
||||
TempValue: String;
|
||||
begin
|
||||
DependencyCount := GetArrayLength(Dependency_List);
|
||||
|
||||
if DependencyCount > 0 then begin
|
||||
Dependency_DownloadPage.Show;
|
||||
|
||||
for DependencyIndex := 0 to DependencyCount - 1 do begin
|
||||
if Dependency_List[DependencyIndex].URL <> '' then begin
|
||||
Dependency_DownloadPage.Clear;
|
||||
Dependency_DownloadPage.Add(Dependency_List[DependencyIndex].URL, Dependency_List[DependencyIndex].Filename, Dependency_List[DependencyIndex].Checksum);
|
||||
|
||||
Retry := True;
|
||||
while Retry do begin
|
||||
Retry := False;
|
||||
|
||||
try
|
||||
Dependency_DownloadPage.Download;
|
||||
except
|
||||
if Dependency_DownloadPage.AbortedByUser then begin
|
||||
Result := Dependency_List[DependencyIndex].Title;
|
||||
DependencyIndex := DependencyCount;
|
||||
end else begin
|
||||
case SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbError, MB_ABORTRETRYIGNORE, IDIGNORE) of
|
||||
IDABORT: begin
|
||||
Result := Dependency_List[DependencyIndex].Title;
|
||||
DependencyIndex := DependencyCount;
|
||||
end;
|
||||
IDRETRY: begin
|
||||
Retry := True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Result = '' then begin
|
||||
for DependencyIndex := 0 to DependencyCount - 1 do begin
|
||||
Dependency_DownloadPage.SetText(Dependency_List[DependencyIndex].Title, '');
|
||||
Dependency_DownloadPage.SetProgress(DependencyIndex + 1, DependencyCount + 1);
|
||||
|
||||
while True do begin
|
||||
ResultCode := 0;
|
||||
#ifdef Dependency_CustomExecute
|
||||
if {#Dependency_CustomExecute}(ExpandConstant('{tmp}{\}') + Dependency_List[DependencyIndex].Filename, Dependency_List[DependencyIndex].Parameters, ResultCode) then begin
|
||||
#else
|
||||
if ShellExec('', ExpandConstant('{tmp}{\}') + Dependency_List[DependencyIndex].Filename, Dependency_List[DependencyIndex].Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode) then begin
|
||||
#endif
|
||||
if Dependency_List[DependencyIndex].RestartAfter then begin
|
||||
if DependencyIndex = DependencyCount - 1 then begin
|
||||
Dependency_NeedToRestart := True;
|
||||
end else begin
|
||||
NeedsRestart := True;
|
||||
Result := Dependency_List[DependencyIndex].Title;
|
||||
end;
|
||||
break;
|
||||
end else if (ResultCode = 0) or Dependency_List[DependencyIndex].ForceSuccess then begin // ERROR_SUCCESS (0)
|
||||
break;
|
||||
end else if ResultCode = 1641 then begin // ERROR_SUCCESS_REBOOT_INITIATED (1641)
|
||||
NeedsRestart := True;
|
||||
Result := Dependency_List[DependencyIndex].Title;
|
||||
break;
|
||||
end else if ResultCode = 3010 then begin // ERROR_SUCCESS_REBOOT_REQUIRED (3010)
|
||||
Dependency_NeedToRestart := True;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
case SuppressibleMsgBox(FmtMessage(SetupMessage(msgErrorFunctionFailed), [Dependency_List[DependencyIndex].Title, IntToStr(ResultCode)]), mbError, MB_ABORTRETRYIGNORE, IDIGNORE) of
|
||||
IDABORT: begin
|
||||
Result := Dependency_List[DependencyIndex].Title;
|
||||
break;
|
||||
end;
|
||||
IDIGNORE: begin
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if Result <> '' then begin
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
|
||||
if NeedsRestart then begin
|
||||
TempValue := '"' + ExpandConstant('{srcexe}') + '" /restart=1 /LANG="' + ExpandConstant('{language}') + '" /DIR="' + WizardDirValue + '" /GROUP="' + WizardGroupValue + '" /TYPE="' + WizardSetupType(False) + '" /COMPONENTS="' + WizardSelectedComponents(False) + '" /TASKS="' + WizardSelectedTasks(False) + '"';
|
||||
if WizardNoIcons then begin
|
||||
TempValue := TempValue + ' /NOICONS';
|
||||
end;
|
||||
RegWriteStringValue(HKA, 'SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce', '{#SetupSetting("AppName")}', TempValue);
|
||||
end;
|
||||
end;
|
||||
|
||||
Dependency_DownloadPage.Hide;
|
||||
end;
|
||||
end;
|
||||
|
||||
#ifndef Dependency_NoUpdateReadyMemo
|
||||
<event('UpdateReadyMemo')>
|
||||
#endif
|
||||
function Dependency_UpdateReadyMemo(const Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
|
||||
begin
|
||||
Result := '';
|
||||
if MemoUserInfoInfo <> '' then begin
|
||||
Result := Result + MemoUserInfoInfo + Newline + NewLine;
|
||||
end;
|
||||
if MemoDirInfo <> '' then begin
|
||||
Result := Result + MemoDirInfo + Newline + NewLine;
|
||||
end;
|
||||
if MemoTypeInfo <> '' then begin
|
||||
Result := Result + MemoTypeInfo + Newline + NewLine;
|
||||
end;
|
||||
if MemoComponentsInfo <> '' then begin
|
||||
Result := Result + MemoComponentsInfo + Newline + NewLine;
|
||||
end;
|
||||
if MemoGroupInfo <> '' then begin
|
||||
Result := Result + MemoGroupInfo + Newline + NewLine;
|
||||
end;
|
||||
if MemoTasksInfo <> '' then begin
|
||||
Result := Result + MemoTasksInfo;
|
||||
end;
|
||||
|
||||
if Dependency_Memo <> '' then begin
|
||||
if MemoTasksInfo = '' then begin
|
||||
Result := Result + SetupMessage(msgReadyMemoTasks);
|
||||
end;
|
||||
Result := Result + FmtMessage(Dependency_Memo, [Space]);
|
||||
end;
|
||||
end;
|
||||
|
||||
<event('NeedRestart')>
|
||||
function Dependency_NeedRestart: Boolean;
|
||||
begin
|
||||
Result := Dependency_NeedToRestart;
|
||||
end;
|
||||
|
||||
function Dependency_IsX64: Boolean;
|
||||
begin
|
||||
Result := not Dependency_ForceX86 and Is64BitInstallMode;
|
||||
end;
|
||||
|
||||
function Dependency_String(const x86, x64: String): String;
|
||||
begin
|
||||
if Dependency_IsX64 then begin
|
||||
Result := x64;
|
||||
end else begin
|
||||
Result := x86;
|
||||
end;
|
||||
end;
|
||||
|
||||
function Dependency_ArchSuffix: String;
|
||||
begin
|
||||
Result := Dependency_String('', '_x64');
|
||||
end;
|
||||
|
||||
function Dependency_ArchTitle: String;
|
||||
begin
|
||||
Result := Dependency_String(' (x86)', ' (x64)');
|
||||
end;
|
||||
|
||||
function Dependency_IsNetCoreInstalled(const Version: String): Boolean;
|
||||
var
|
||||
ResultCode: Integer;
|
||||
begin
|
||||
// source code: https://github.com/dotnet/deployment-tools/tree/main/src/clickonce/native/projects/NetCoreCheck
|
||||
if not FileExists(ExpandConstant('{tmp}{\}') + 'netcorecheck' + Dependency_ArchSuffix + '.exe') then begin
|
||||
ExtractTemporaryFile('netcorecheck' + Dependency_ArchSuffix + '.exe');
|
||||
end;
|
||||
Result := ShellExec('', ExpandConstant('{tmp}{\}') + 'netcorecheck' + Dependency_ArchSuffix + '.exe', Version, '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0);
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet35;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net35-sp1
|
||||
if not IsDotNetInstalled(net35, 1) then begin
|
||||
Dependency_Add('dotnetfx35.exe',
|
||||
'/lang:enu /passive /norestart',
|
||||
'.NET Framework 3.5 Service Pack 1',
|
||||
'https://download.microsoft.com/download/2/0/E/20E90413-712F-438C-988E-FDAA79A8AC3D/dotnetfx35.exe',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet40;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net40
|
||||
if not IsDotNetInstalled(net4full, 0) then begin
|
||||
Dependency_Add('dotNetFx40_Full_setup.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.0',
|
||||
'https://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet45;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net452
|
||||
if not IsDotNetInstalled(net452, 0) then begin
|
||||
Dependency_Add('dotnetfx45.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.5.2',
|
||||
'https://go.microsoft.com/fwlink/?LinkId=397707',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet46;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net462
|
||||
if not IsDotNetInstalled(net462, 0) then begin
|
||||
Dependency_Add('dotnetfx46.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.6.2',
|
||||
'https://go.microsoft.com/fwlink/?linkid=780596',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet47;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net472
|
||||
if not IsDotNetInstalled(net472, 0) then begin
|
||||
Dependency_Add('dotnetfx47.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.7.2',
|
||||
'https://go.microsoft.com/fwlink/?LinkId=863262',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet48;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net48
|
||||
if not IsDotNetInstalled(net48, 0) then begin
|
||||
Dependency_Add('dotnetfx48.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.8',
|
||||
'https://go.microsoft.com/fwlink/?LinkId=2085155',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet481;
|
||||
var
|
||||
Version: Cardinal;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-framework/net481
|
||||
if not RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', Version) or (Version < 533320) then begin
|
||||
Dependency_Add('dotnetfx481.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Framework 4.8.1',
|
||||
'https://go.microsoft.com/fwlink/?LinkId=2203304',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddNetCore31;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-core/3.1
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 3.1.32') then begin
|
||||
Dependency_Add('netcore31' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Core Runtime 3.1.32' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/de4b3438-24a2-4d1d-a845-97355cf97b71/515abb880478b49f7c1bced8fbf07b16/dotnet-runtime-3.1.32-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/476eba79-f17f-49c8-a213-0f24a22cd026/37c02de81ff5b76ac57a5427462395f1/dotnet-runtime-3.1.32-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddNetCore31Asp;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-core/3.1
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.AspNetCore.App -v 3.1.32') then begin
|
||||
Dependency_Add('netcore31asp' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'ASP.NET Core Runtime 3.1.32' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/63b482d2-04b2-4dd4-baaf-d1e78de80738/40321091c872f4e77337b68fc61a5a07/aspnetcore-runtime-3.1.32-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/98910750-2644-472c-ab2b-17f315ccb953/c2a4c223ee11e2eec7d13744e7a45547/aspnetcore-runtime-3.1.32-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddNetCore31Desktop;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet-core/3.1
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.WindowsDesktop.App -v 3.1.32') then begin
|
||||
Dependency_Add('netcore31desktop' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Desktop Runtime 3.1.32' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/3f353d2c-0431-48c5-bdf6-fbbe8f901bb5/542a4af07c1df5136a98a1c2df6f3d62/windowsdesktop-runtime-3.1.32-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/b92958c6-ae36-4efa-aafe-569fced953a5/1654639ef3b20eb576174c1cc200f33a/windowsdesktop-runtime-3.1.32-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet50;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/5.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 5.0.17') then begin
|
||||
Dependency_Add('dotnet50' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Runtime 5.0.17' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/54683c13-6b04-4d7d-b4d4-1f055b50ea43/e99048e2840d57040e8312058853a5b9/dotnet-runtime-5.0.17-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/a0832b5a-6900-442b-af79-6ffddddd6ba4/e2df0b25dd851ee0b38a86947dd0e42e/dotnet-runtime-5.0.17-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet50Asp;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/5.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.AspNetCore.App -v 5.0.17') then begin
|
||||
Dependency_Add('dotnet50asp' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'ASP.NET Core Runtime 5.0.17' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/4bfa247d-321d-4b29-a34b-62320849059b/8df7a17d9aad4044efe9b5b1c423e82c/aspnetcore-runtime-5.0.17-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/3789ec90-2717-424f-8b9c-3adbbcea6c16/2085cc5ff077b8789ff938015392e406/aspnetcore-runtime-5.0.17-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet50Desktop;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/5.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.WindowsDesktop.App -v 5.0.17') then begin
|
||||
Dependency_Add('dotnet50desktop' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Desktop Runtime 5.0.17' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/b6fe5f2a-95f4-46f1-9824-f5994f10bc69/db5ec9b47ec877b5276f83a185fdb6a0/windowsdesktop-runtime-5.0.17-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/3aa4e942-42cd-4bf5-afe7-fc23bd9c69c5/64da54c8864e473c19a7d3de15790418/windowsdesktop-runtime-5.0.17-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet60;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/6.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 6.0.20') then begin
|
||||
Dependency_Add('dotnet60' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Runtime 6.0.20' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/3be5ee3a-c171-4cd2-ab98-00ca5c11eb8c/6fd31294b0c6c670ab5c060592935203/dotnet-runtime-6.0.20-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/3cfb6d2a-afbe-4ae7-8e5b-776f350654cc/6e8d858a60fe15381f3c84d8ca66c4a7/dotnet-runtime-6.0.20-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet60Asp;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/6.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.AspNetCore.App -v 6.0.20') then begin
|
||||
Dependency_Add('dotnet60asp' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'ASP.NET Core Runtime 6.0.20' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/0e37c76c-53b4-4eea-8f5c-6ad2f8d5fe3c/88a8620329ced1aee271992a5b56d236/aspnetcore-runtime-6.0.20-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/be9f67fd-60af-45b1-9bca-a7bcc0e86e7e/6a750f7d7432937b3999bb4c5325062a/aspnetcore-runtime-6.0.20-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet60Desktop;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/6.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.WindowsDesktop.App -v 6.0.20') then begin
|
||||
Dependency_Add('dotnet60desktop' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Desktop Runtime 6.0.20' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/0413b619-3eb2-4178-a78e-8d1aafab1a01/5247f08ea3c13849b68074a2142fbf31/windowsdesktop-runtime-6.0.20-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/1146f414-17c7-4184-8b10-1addfa5315e4/39db5573efb029130add485566320d74/windowsdesktop-runtime-6.0.20-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet70;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/7.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 7.0.9') then begin
|
||||
Dependency_Add('dotnet70' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Runtime 7.0.9' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/305a85f5-2b0d-459b-b2ea-caf71b98d25d/805edc610efa49432e5e268bbba4eacb/dotnet-runtime-7.0.9-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/73058888-02a4-4f6d-b3cd-845531c2d7d0/a785e54b7f12046c00714b2ba759e173/dotnet-runtime-7.0.9-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet70Asp;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/7.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.AspNetCore.App -v 7.0.9') then begin
|
||||
Dependency_Add('dotnet70asp' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'ASP.NET Core Runtime 7.0.9' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/6ec3b357-31df-4b18-948f-4979a5b4b99f/fdeec71fc7f0f34ecfa0cb8b2b897da0/aspnetcore-runtime-7.0.9-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/edd9c9b1-0c49-4297-9197-9392b2462318/d06fedaefb256d801ce94ade76af3ad9/aspnetcore-runtime-7.0.9-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet70Desktop;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/7.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.WindowsDesktop.App -v 7.0.9') then begin
|
||||
Dependency_Add('dotnet70desktop' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Desktop Runtime 7.0.9' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/139b19d0-2d39-48ce-b59a-aec437509c20/ea6a2711eec53660c3b14d78b9fb2963/windowsdesktop-runtime-7.0.9-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/7727acb3-25ca-473b-a392-75afeb33cab7/f11f0477fd2fcfbb3111881377d0c9bb/windowsdesktop-runtime-7.0.9-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure Dependency_AddDotNet80;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/8.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.NETCore.App -v 8.0.3') then begin
|
||||
Dependency_Add('dotnet80' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Runtime 8.0.3' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/c8d7a77c-5647-4e38-9ed8-edf82328497d/56130e071ac13c3660b0f3a0d60914c7/dotnet-runtime-8.0.3-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/961dfc84-ea72-48a2-b3f4-b82cefc34580/6ac50b6bf244a2c5481ad705a92cf843/dotnet-runtime-8.0.3-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet80Asp;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/8.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.AspNetCore.App -v 8.0.3') then begin
|
||||
Dependency_Add('dotnet80asp' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'ASP.NET Core Runtime 8.0.3' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/e1efd12b-9598-4b70-ad83-496563ae3f7c/da67696e4232886f52d50bb8ecda5ab1/aspnetcore-runtime-8.0.3-win-x86.zip', 'https://download.visualstudio.microsoft.com/download/pr/e91876a9-1760-42cb-a6f4-97c57e9cca52/b433fcf4768929539f17e1908cb315bf/aspnetcore-runtime-8.0.3-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDotNet80Desktop;
|
||||
begin
|
||||
// https://dotnet.microsoft.com/download/dotnet/8.0
|
||||
if not Dependency_IsNetCoreInstalled('-n Microsoft.WindowsDesktop.App -v 8.0.3') then begin
|
||||
Dependency_Add('dotnet80desktop' + Dependency_ArchSuffix + '.exe',
|
||||
'/lcid ' + IntToStr(GetUILanguage) + ' /passive /norestart',
|
||||
'.NET Desktop Runtime 8.0.3' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/c629f243-5125-4751-a5ff-e78fa45646b1/85777e3e3f58f863d884fd4b8a1453f2/windowsdesktop-runtime-8.0.3-win-x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/51bc18ac-0594-412d-bd63-18ece4c91ac4/90b47b97c3bfe40a833791b166697e67/windowsdesktop-runtime-8.0.3-win-x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2005;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=26347
|
||||
if not IsMsiProductInstalled(Dependency_String('{86C9D5AA-F00C-4921-B3F2-C60AF92E2844}', '{A8D19029-8E5C-4E22-8011-48070F9E796E}'), PackVersionComponents(8, 0, 61000, 0)) then begin
|
||||
Dependency_Add('vcredist2005' + Dependency_ArchSuffix + '.exe',
|
||||
'/q',
|
||||
'Visual C++ 2005 Service Pack 1 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE', 'https://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x64.EXE'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2008;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=26368
|
||||
if not IsMsiProductInstalled(Dependency_String('{DE2C306F-A067-38EF-B86C-03DE4B0312F9}', '{FDA45DDF-8E17-336F-A3ED-356B7B7C688A}'), PackVersionComponents(9, 0, 30729, 6161)) then begin
|
||||
Dependency_Add('vcredist2008' + Dependency_ArchSuffix + '.exe',
|
||||
'/q',
|
||||
'Visual C++ 2008 Service Pack 1 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe', 'https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2010;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=26999
|
||||
if not IsMsiProductInstalled(Dependency_String('{1F4F1D2A-D9DA-32CF-9909-48485DA06DD5}', '{5B75F761-BAC8-33BC-A381-464DDDD813A3}'), PackVersionComponents(10, 0, 40219, 0)) then begin
|
||||
Dependency_Add('vcredist2010' + Dependency_ArchSuffix + '.exe',
|
||||
'/passive /norestart',
|
||||
'Visual C++ 2010 Service Pack 1 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe', 'https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2012;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=30679
|
||||
if not IsMsiProductInstalled(Dependency_String('{4121ED58-4BD9-3E7B-A8B5-9F8BAAE045B7}', '{EFA6AFA1-738E-3E00-8101-FD03B86B29D1}'), PackVersionComponents(11, 0, 61030, 0)) then begin
|
||||
Dependency_Add('vcredist2012' + Dependency_ArchSuffix + '.exe',
|
||||
'/passive /norestart',
|
||||
'Visual C++ 2012 Update 4 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x86.exe', 'https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2013;
|
||||
begin
|
||||
// https://support.microsoft.com/en-us/help/4032938
|
||||
if not IsMsiProductInstalled(Dependency_String('{B59F5BF1-67C8-3802-8E59-2CE551A39FC5}', '{20400CF0-DE7C-327E-9AE4-F0F38D9085F8}'), PackVersionComponents(12, 0, 40664, 0)) then begin
|
||||
Dependency_Add('vcredist2013' + Dependency_ArchSuffix + '.exe',
|
||||
'/passive /norestart',
|
||||
'Visual C++ 2013 Update 5 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.visualstudio.microsoft.com/download/pr/10912113/5da66ddebb0ad32ebd4b922fd82e8e25/vcredist_x86.exe', 'https://download.visualstudio.microsoft.com/download/pr/10912041/cee5d6bca2ddbcd039da727bf4acb48a/vcredist_x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddVC2015To2022;
|
||||
begin
|
||||
// https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist
|
||||
if not IsMsiProductInstalled(Dependency_String('{65E5BD06-6392-3027-8C26-853107D3CF1A}', '{36F68A90-239C-34DF-B58C-64B30153CE35}'), PackVersionComponents(14, 30, 30704, 0)) then begin
|
||||
Dependency_Add('vcredist2022' + Dependency_ArchSuffix + '.exe',
|
||||
'/passive /norestart',
|
||||
'Visual C++ 2015-2022 Redistributable' + Dependency_ArchTitle,
|
||||
Dependency_String('https://aka.ms/vs/17/release/vc_redist.x86.exe', 'https://aka.ms/vs/17/release/vc_redist.x64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddDirectX;
|
||||
begin
|
||||
#ifdef Dependency_Files_DirectX
|
||||
ExtractTemporaryFile('dxwebsetup.exe');
|
||||
#endif
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=35
|
||||
Dependency_Add('dxwebsetup.exe',
|
||||
'/q',
|
||||
'DirectX Runtime',
|
||||
'https://download.microsoft.com/download/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C/dxwebsetup.exe',
|
||||
'', True, False);
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2008Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=30438
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(10, 50, 4000, 0)) < 0) then begin
|
||||
Dependency_Add('sql2008express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2008 R2 Service Pack 2 Express',
|
||||
Dependency_String('https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR32_x86_ENU.exe', 'https://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPR_x64_ENU.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2012Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=56042
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(11, 0, 7001, 0)) < 0) then begin
|
||||
Dependency_Add('sql2012express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2012 Service Pack 4 Express',
|
||||
Dependency_String('https://download.microsoft.com/download/B/D/E/BDE8FAD6-33E5-44F6-B714-348F73E602B6/SQLEXPR32_x86_ENU.exe', 'https://download.microsoft.com/download/B/D/E/BDE8FAD6-33E5-44F6-B714-348F73E602B6/SQLEXPR_x64_ENU.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2014Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=57473
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(12, 0, 6024, 0)) < 0) then begin
|
||||
Dependency_Add('sql2014express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2014 Service Pack 3 Express',
|
||||
Dependency_String('https://download.microsoft.com/download/3/9/F/39F968FA-DEBB-4960-8F9E-0E7BB3035959/SQLEXPR32_x86_ENU.exe', 'https://download.microsoft.com/download/3/9/F/39F968FA-DEBB-4960-8F9E-0E7BB3035959/SQLEXPR_x64_ENU.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2016Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=103447
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(13, 0, 6404, 1)) < 0) then begin
|
||||
Dependency_Add('sql2016express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2016 Service Pack 3 Express',
|
||||
'https://download.microsoft.com/download/f/a/8/fa83d147-63d1-449c-b22d-5fef9bd5bb46/SQLServer2016-SSEI-Expr.exe',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2017Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=55994
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(14, 0, 0, 0)) < 0) then begin
|
||||
Dependency_Add('sql2017express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2017 Express',
|
||||
'https://download.microsoft.com/download/5/E/9/5E9B18CC-8FD5-467E-B5BF-BADE39C51F73/SQLServer2017-SSEI-Expr.exe',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2019Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=101064
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(15, 0, 0, 0)) < 0) then begin
|
||||
Dependency_Add('sql2019express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2019 Express',
|
||||
'https://download.microsoft.com/download/7/f/8/7f8a9c43-8c8a-4f7c-9f92-83c18d96b681/SQL2019-SSEI-Expr.exe',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddSql2022Express;
|
||||
var
|
||||
Version: String;
|
||||
PackedVersion: Int64;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=104781
|
||||
if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQLServer\CurrentVersion', 'CurrentVersion', Version) or not StrToVersion(Version, PackedVersion) or (ComparePackedVersion(PackedVersion, PackVersionComponents(16, 0, 1000, 6)) < 0) then begin
|
||||
Dependency_Add('sql2022express' + Dependency_ArchSuffix + '.exe',
|
||||
'/QS /IACCEPTSQLSERVERLICENSETERMS /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER',
|
||||
'SQL Server 2022 Express',
|
||||
'https://go.microsoft.com/fwlink/p/?linkid=2216019',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddWebView2;
|
||||
begin
|
||||
// https://developer.microsoft.com/en-us/microsoft-edge/webview2
|
||||
if not RegValueExists(HKLM, Dependency_String('SOFTWARE', 'SOFTWARE\WOW6432Node') + '\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}', 'pv') then begin
|
||||
Dependency_Add('MicrosoftEdgeWebview2Setup.exe',
|
||||
'/silent /install',
|
||||
'WebView2 Runtime',
|
||||
'https://go.microsoft.com/fwlink/p/?LinkId=2124703',
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddAccessDatabaseEngine2010;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=13255
|
||||
if not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Office\14.0\Access Connectivity Engine\Engines\ACE') then begin
|
||||
Dependency_Add('AccessDatabaseEngine2010' + Dependency_ArchSuffix + '.exe',
|
||||
'/quiet',
|
||||
'Microsoft Access Database Engine 2010' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine.exe', 'https://download.microsoft.com/download/2/4/3/24375141-E08D-4803-AB0E-10F2E3A07AAA/AccessDatabaseEngine_X64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Dependency_AddAccessDatabaseEngine2016;
|
||||
begin
|
||||
// https://www.microsoft.com/en-us/download/details.aspx?id=54920
|
||||
if not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Office\16.0\Access Connectivity Engine\Engines\ACE') then begin
|
||||
Dependency_Add('AccessDatabaseEngine2016' + Dependency_ArchSuffix + '.exe',
|
||||
'/quiet',
|
||||
'Microsoft Access Database Engine 2016' + Dependency_ArchTitle,
|
||||
Dependency_String('https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/accessdatabaseengine.exe', 'https://download.microsoft.com/download/3/5/C/35C84C36-661A-44E6-9324-8786B8DBE231/accessdatabaseengine_X64.exe'),
|
||||
'', False, False);
|
||||
end;
|
||||
end;
|
||||
|
||||
[Files]
|
||||
#ifdef Dependency_Path_NetCoreCheck
|
||||
; download netcorecheck.exe: https://www.nuget.org/packages/Microsoft.NET.Tools.NETCoreCheck.x86
|
||||
; download netcorecheck_x64.exe: https://www.nuget.org/packages/Microsoft.NET.Tools.NETCoreCheck.x64
|
||||
Source: "{#Dependency_Path_NetCoreCheck}netcorecheck.exe"; Flags: dontcopy noencryption
|
||||
Source: "{#Dependency_Path_NetCoreCheck}netcorecheck_x64.exe"; Flags: dontcopy noencryption
|
||||
#endif
|
||||
|
||||
#ifdef Dependency_Path_DirectX
|
||||
Source: "{#Dependency_Path_DirectX}dxwebsetup.exe"; Flags: dontcopy noencryption
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
BIN
gui/dependencies/redist/VC_redist.x64.exe
Normal file
BIN
gui/dependencies/redist/VC_redist.x64.exe
Normal file
Binary file not shown.
@@ -79,7 +79,7 @@
|
||||
"settingsClientDescription": "Configure the internal files used by the launcher for Fortnite",
|
||||
"settingsClientOptionsName": "Options",
|
||||
"settingsClientOptionsDescription": "Configure additional options for Fortnite",
|
||||
"settingsClientConsoleName": "Unreal engine console",
|
||||
"settingsClientConsoleName": "Unreal engine patcher",
|
||||
"settingsClientConsoleDescription": "Unlocks the Unreal Engine Console",
|
||||
"settingsClientConsoleKeyName": "Unreal engine console key",
|
||||
"settingsClientConsoleKeyDescription": "The keyboard key used to open the Unreal Engine console",
|
||||
@@ -88,7 +88,7 @@
|
||||
"settingsClientMemoryName": "Memory patcher",
|
||||
"settingsClientMemoryDescription": "Prevents the client from crashing because of a memory leak",
|
||||
"settingsClientArgsName": "Custom launch arguments",
|
||||
"settingsClientArgsDescription": "Additional arguments to use when launching the game",
|
||||
"settingsClientArgsDescription": "Additional arguments to use when launching Fortnite",
|
||||
"settingsClientArgsPlaceholder": "Arguments...",
|
||||
"settingsServerName": "Internal files",
|
||||
"settingsServerSubtitle": "Configure the internal files used by the launcher for the game server",
|
||||
@@ -118,9 +118,7 @@
|
||||
"settingsUtilsResetDefaultsName": "Reset settings",
|
||||
"settingsUtilsResetDefaultsSubtitle": "Resets the launcher's settings to their default values",
|
||||
"settingsUtilsDialogTitle": "Do you want to reset all the setting in this tab to their default values? This action is irreversible",
|
||||
"settingsUtilsResetDefaultsContent": "Reset",
|
||||
"settingsUtilsDialogSecondaryAction": "Close",
|
||||
"settingsUtilsDialogPrimaryAction": "Reset",
|
||||
"selectFortniteName": "Fortnite version",
|
||||
"selectFortniteDescription": "Select the version of Fortnite you want to use",
|
||||
"manageVersionsName": "Manage versions",
|
||||
@@ -147,6 +145,7 @@
|
||||
"defaultServerName": "Reboot Game Server",
|
||||
"defaultServerDescription": "Just another server",
|
||||
"downloadingDll": "Downloading {name} dll...",
|
||||
"dllAlreadyExists": "The {name} was already downloaded",
|
||||
"downloadDllSuccess": "The {name} dll was downloaded successfully",
|
||||
"downloadDllError": "An error occurred while downloading {name}: {error}",
|
||||
"downloadDllRetry": "Retry",
|
||||
@@ -156,6 +155,7 @@
|
||||
"launchingGameClientAndServer": "Launching the game client and server...",
|
||||
"startGameServer": "Start a game server",
|
||||
"usernameOrEmail": "Username/Email",
|
||||
"invalidEmail": "Invalid email",
|
||||
"usernameOrEmailPlaceholder": "Type your username or email",
|
||||
"password": "Password",
|
||||
"passwordPlaceholder": "Type your password, if you want to use one",
|
||||
@@ -261,6 +261,7 @@
|
||||
"missingCustomDllError": "The custom {dll}.dll doesn't exist: check your settings",
|
||||
"tokenError": "Cannot log in into Fortnite: authentication error (injected dlls: {dlls})",
|
||||
"unknownFortniteError": "An unknown error occurred while launching Fortnite: {error}",
|
||||
"fortniteCrashError": "The {name} crashed after being launched",
|
||||
"serverNoLongerAvailableUnnamed": "The previous server is no longer available",
|
||||
"noServerFound": "No server found: invalid or expired link",
|
||||
"settingsUtilsThemeName": "Theme",
|
||||
@@ -320,6 +321,7 @@
|
||||
"none": "none",
|
||||
"openLog": "Open log",
|
||||
"backendProcessError": "The backend shut down unexpectedly",
|
||||
"backendErrorMessage": "The backend reported an unexpected error",
|
||||
"welcomeTitle": "Welcome to Reboot Launcher",
|
||||
"welcomeDescription": "If you have never used a Fortnite game server, or this launcher in particular, please click on take a tour\nPlease don't ask for support on Discord without taking the tour: this helps me prioritize real bugs\nYou can always take the tour again in the Info tab",
|
||||
"welcomeAction": "Take the tour",
|
||||
@@ -359,9 +361,12 @@
|
||||
"promptBackendDetachedActionLabel": "Next",
|
||||
"promptInfoTabText": "The Info tab contains useful links to report bugs and receive support",
|
||||
"promptInfoTabActionLabel": "Next",
|
||||
"promptSettingsTabText": "The Settings tab contains options to customize and reset the launcher",
|
||||
"promptSettingsTabText": "The Settings tab contains options to customize the launcher",
|
||||
"promptSettingsTabActionLabel": "Done",
|
||||
"automaticGameServerDialogContent": "The launcher detected that you are not running a game server, but that your matchmaker is set to your local machine. If you don't want to join another player's server, you should start a game server. This is necessary to be able to play!",
|
||||
"automaticGameServerDialogIgnore": "Ignore",
|
||||
"automaticGameServerDialogStart": "Start server"
|
||||
"automaticGameServerDialogStart": "Start server",
|
||||
"gameResetDefaultsName": "Reset",
|
||||
"gameResetDefaultsDescription": "Resets the game's settings to their default values",
|
||||
"gameResetDefaultsContent": "Reset"
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ import 'package:local_notifier/local_notifier.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/src/controller/backend_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/dll_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/game_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/hosting_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/error.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/server.dart';
|
||||
import 'package:reboot_launcher/src/page/implementation/home_page.dart';
|
||||
import 'package:reboot_launcher/src/util/os.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
@@ -172,7 +172,6 @@ void _initWindow() => doWhenWindowReady(() async {
|
||||
appWindow.alignment = Alignment.center;
|
||||
}
|
||||
|
||||
appWindow.minSize = const Size(kDefaultWindowWidth, kDefaultWindowHeight);
|
||||
if(isWin11) {
|
||||
await Window.setEffect(
|
||||
effect: WindowEffect.acrylic,
|
||||
@@ -190,10 +189,11 @@ void _initWindow() => doWhenWindowReady(() async {
|
||||
Future<List<Object>> _initStorage() async {
|
||||
final errors = <Object>[];
|
||||
try {
|
||||
await GetStorage("game_storage", settingsDirectory.path).initStorage;
|
||||
await GetStorage("backend_storage", settingsDirectory.path).initStorage;
|
||||
await GetStorage("settings_storage", settingsDirectory.path).initStorage;
|
||||
await GetStorage("hosting_storage", settingsDirectory.path).initStorage;
|
||||
await GetStorage(GameController.storageName, settingsDirectory.path).initStorage;
|
||||
await GetStorage(BackendController.storageName, settingsDirectory.path).initStorage;
|
||||
await GetStorage(SettingsController.storageName, settingsDirectory.path).initStorage;
|
||||
await GetStorage(HostingController.storageName, settingsDirectory.path).initStorage;
|
||||
await GetStorage(DllController.storageName, settingsDirectory.path).initStorage;
|
||||
}catch(error) {
|
||||
appWithNoStorage = true;
|
||||
errors.add("The Reboot Launcher configuration in ${settingsDirectory.path} cannot be accessed: running with in memory storage");
|
||||
@@ -225,6 +225,12 @@ Future<List<Object>> _initStorage() async {
|
||||
errors.add(error);
|
||||
}
|
||||
|
||||
try {
|
||||
Get.put(DllController());
|
||||
}catch(error) {
|
||||
errors.add(error);
|
||||
}
|
||||
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
@@ -2,32 +2,39 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/main.dart';
|
||||
import 'package:reboot_launcher/src/util/keyboard.dart';
|
||||
|
||||
class BackendController extends GetxController {
|
||||
late final GetStorage? storage;
|
||||
static const String storageName = "backend_storage";
|
||||
static const PhysicalKeyboardKey _kDefaultConsoleKey = PhysicalKeyboardKey(0x00070041);
|
||||
|
||||
late final GetStorage? _storage;
|
||||
late final TextEditingController host;
|
||||
late final TextEditingController port;
|
||||
late final Rx<ServerType> type;
|
||||
late final TextEditingController gameServerAddress;
|
||||
late final FocusNode gameServerAddressFocusNode;
|
||||
late final Rx<PhysicalKeyboardKey> consoleKey;
|
||||
late final RxBool started;
|
||||
late final RxBool detached;
|
||||
StreamSubscription? worker;
|
||||
int? embeddedProcessPid;
|
||||
HttpServer? localServer;
|
||||
HttpServer? remoteServer;
|
||||
|
||||
BackendController() {
|
||||
storage = appWithNoStorage ? null : GetStorage("backend_storage");
|
||||
_storage = appWithNoStorage ? null : GetStorage(storageName);
|
||||
started = RxBool(false);
|
||||
type = Rx(ServerType.values.elementAt(storage?.read("type") ?? 0));
|
||||
type = Rx(ServerType.values.elementAt(_storage?.read("type") ?? 0));
|
||||
type.listen((value) {
|
||||
host.text = _readHost();
|
||||
port.text = _readPort();
|
||||
storage?.write("type", value.index);
|
||||
_storage?.write("type", value.index);
|
||||
if (!started.value) {
|
||||
return;
|
||||
}
|
||||
@@ -36,13 +43,13 @@ class BackendController extends GetxController {
|
||||
});
|
||||
host = TextEditingController(text: _readHost());
|
||||
host.addListener(() =>
|
||||
storage?.write("${type.value.name}_host", host.text));
|
||||
_storage?.write("${type.value.name}_host", host.text));
|
||||
port = TextEditingController(text: _readPort());
|
||||
port.addListener(() =>
|
||||
storage?.write("${type.value.name}_port", port.text));
|
||||
detached = RxBool(storage?.read("detached") ?? false);
|
||||
detached.listen((value) => storage?.write("detached", value));
|
||||
final address = storage?.read("game_server_address");
|
||||
_storage?.write("${type.value.name}_port", port.text));
|
||||
detached = RxBool(_storage?.read("detached") ?? false);
|
||||
detached.listen((value) => _storage?.write("detached", value));
|
||||
final address = _storage?.read("game_server_address");
|
||||
gameServerAddress = TextEditingController(text: address == null || address.isEmpty ? "127.0.0.1" : address);
|
||||
var lastValue = gameServerAddress.text;
|
||||
writeMatchmakingIp(lastValue);
|
||||
@@ -54,7 +61,7 @@ class BackendController extends GetxController {
|
||||
|
||||
lastValue = newValue;
|
||||
gameServerAddress.selection = TextSelection.collapsed(offset: newValue.length);
|
||||
storage?.write("game_server_address", newValue);
|
||||
_storage?.write("game_server_address", newValue);
|
||||
writeMatchmakingIp(newValue);
|
||||
});
|
||||
watchMatchmakingIp().listen((event) {
|
||||
@@ -63,6 +70,37 @@ class BackendController extends GetxController {
|
||||
}
|
||||
});
|
||||
gameServerAddressFocusNode = FocusNode();
|
||||
consoleKey = Rx(_readConsoleKey());
|
||||
_writeConsoleKey(consoleKey.value);
|
||||
consoleKey.listen((newValue) {
|
||||
_storage?.write("console_key", newValue.usbHidUsage);
|
||||
_writeConsoleKey(newValue);
|
||||
});
|
||||
}
|
||||
|
||||
PhysicalKeyboardKey _readConsoleKey() {
|
||||
final consoleKeyValue = _storage?.read("console_key");
|
||||
if(consoleKeyValue == null) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
final consoleKeyNumber = int.tryParse(consoleKeyValue.toString());
|
||||
if(consoleKeyNumber == null) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
final consoleKey = PhysicalKeyboardKey(consoleKeyNumber);
|
||||
if(!consoleKey.isUnrealEngineKey) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
return consoleKey;
|
||||
}
|
||||
|
||||
Future<void> _writeConsoleKey(PhysicalKeyboardKey keyValue) async {
|
||||
final defaultInput = File("${backendDirectory.path}\\CloudStorage\\DefaultInput.ini");
|
||||
await defaultInput.parent.create(recursive: true);
|
||||
await defaultInput.writeAsString("[/Script/Engine.InputSettings]\n+ConsoleKeys=Tilde\n+ConsoleKeys=${keyValue.unrealEngineName}", flush: true);
|
||||
}
|
||||
|
||||
void joinLocalhost() {
|
||||
@@ -72,18 +110,19 @@ class BackendController extends GetxController {
|
||||
void reset() async {
|
||||
type.value = ServerType.values.elementAt(0);
|
||||
for (final type in ServerType.values) {
|
||||
storage?.write("${type.name}_host", null);
|
||||
storage?.write("${type.name}_port", null);
|
||||
_storage?.write("${type.name}_host", null);
|
||||
_storage?.write("${type.name}_port", null);
|
||||
}
|
||||
|
||||
host.text = type.value != ServerType.remote ? kDefaultBackendHost : "";
|
||||
port.text = kDefaultBackendPort.toString();
|
||||
gameServerAddress.text = "127.0.0.1";
|
||||
consoleKey.value = _kDefaultConsoleKey;
|
||||
detached.value = false;
|
||||
}
|
||||
|
||||
String _readHost() {
|
||||
String? value = storage?.read("${type.value.name}_host");
|
||||
String? value = _storage?.read("${type.value.name}_host");
|
||||
if (value != null && value.isNotEmpty) {
|
||||
return value;
|
||||
}
|
||||
@@ -96,24 +135,20 @@ class BackendController extends GetxController {
|
||||
}
|
||||
|
||||
String _readPort() =>
|
||||
storage?.read("${type.value.name}_port") ?? kDefaultBackendPort.toString();
|
||||
_storage?.read("${type.value.name}_port") ?? kDefaultBackendPort.toString();
|
||||
|
||||
Stream<ServerResult> start() async* {
|
||||
Stream<ServerResult> start({required void Function() onExit, required void Function(String) onError}) async* {
|
||||
try {
|
||||
if(started.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
final serverType = type.value;
|
||||
final hostData = this.host.text.trim();
|
||||
final portData = this.port.text.trim();
|
||||
if(type() != ServerType.local) {
|
||||
started.value = true;
|
||||
if(serverType != ServerType.local || portData != kDefaultBackendPort.toString()) {
|
||||
yield ServerResult(ServerResultType.starting);
|
||||
}else {
|
||||
started.value = false;
|
||||
if(portData != kDefaultBackendPort.toString()) {
|
||||
yield ServerResult(ServerResultType.starting);
|
||||
}
|
||||
}
|
||||
|
||||
if (hostData.isEmpty) {
|
||||
@@ -135,7 +170,7 @@ class BackendController extends GetxController {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((type() != ServerType.local || portData != kDefaultBackendPort.toString()) && !(await isBackendPortFree())) {
|
||||
if ((serverType != ServerType.local || portData != kDefaultBackendPort.toString()) && !(await isBackendPortFree())) {
|
||||
yield ServerResult(ServerResultType.freeingPort);
|
||||
final result = await freeBackendPort();
|
||||
yield ServerResult(result ? ServerResultType.freePortSuccess : ServerResultType.freePortError);
|
||||
@@ -145,14 +180,21 @@ class BackendController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
switch(type()){
|
||||
switch(serverType){
|
||||
case ServerType.embedded:
|
||||
final process = await startEmbeddedBackend(detached.value);
|
||||
watchProcess(process.pid)
|
||||
.asStream()
|
||||
.asBroadcastStream()
|
||||
.where((_) => !started())
|
||||
.map((_) => ServerResult(ServerResultType.processError));
|
||||
final process = await startEmbeddedBackend(detached.value, onError: (errorMessage) {
|
||||
if(started.value) {
|
||||
started.value = false;
|
||||
onError(errorMessage);
|
||||
}
|
||||
});
|
||||
watchProcess(process.pid).then((_) {
|
||||
if(started.value) {
|
||||
started.value = false;
|
||||
onExit();
|
||||
}
|
||||
});
|
||||
embeddedProcessPid = process.pid;
|
||||
break;
|
||||
case ServerType.remote:
|
||||
yield ServerResult(ServerResultType.pingingRemote);
|
||||
@@ -166,8 +208,20 @@ class BackendController extends GetxController {
|
||||
remoteServer = await startRemoteBackendProxy(uriResult);
|
||||
break;
|
||||
case ServerType.local:
|
||||
if(portData != kDefaultBackendPort.toString()) {
|
||||
if(portNumber != kDefaultBackendPort) {
|
||||
yield ServerResult(ServerResultType.pingingLocal);
|
||||
final uriResult = await pingBackend(kDefaultBackendHost, portNumber);
|
||||
if(uriResult == null) {
|
||||
yield ServerResult(ServerResultType.pingError);
|
||||
started.value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
localServer = await startRemoteBackendProxy(Uri.parse("http://$kDefaultBackendHost:$portData"));
|
||||
}else {
|
||||
// If the local server is running on port 3551 there is no reverse proxy running
|
||||
// We only need to check if everything is working
|
||||
started.value = false;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -206,7 +260,11 @@ class BackendController extends GetxController {
|
||||
try{
|
||||
switch(type()){
|
||||
case ServerType.embedded:
|
||||
killProcessByPort(kDefaultBackendPort);
|
||||
final embeddedProcessPid = this.embeddedProcessPid;
|
||||
if(embeddedProcessPid != null) {
|
||||
Process.killPid(embeddedProcessPid, ProcessSignal.sigterm);
|
||||
this.embeddedProcessPid = null;
|
||||
}
|
||||
break;
|
||||
case ServerType.remote:
|
||||
await remoteServer?.close(force: true);
|
||||
@@ -228,11 +286,14 @@ class BackendController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Stream<ServerResult> toggle() async* {
|
||||
Stream<ServerResult> toggle({required void Function() onExit, required void Function(String) onError}) async* {
|
||||
if(started()) {
|
||||
yield* stop();
|
||||
}else {
|
||||
yield* start();
|
||||
yield* start(
|
||||
onExit: onExit,
|
||||
onError: onError
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
249
gui/lib/src/controller/dll_controller.dart
Normal file
249
gui/lib/src/controller/dll_controller.dart
Normal file
@@ -0,0 +1,249 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:path/path.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/main.dart';
|
||||
import 'package:reboot_launcher/src/messenger/abstract/info_bar.dart';
|
||||
import 'package:reboot_launcher/src/util/translations.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:version/version.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
class DllController extends GetxController {
|
||||
static const String storageName = "dll_storage";
|
||||
|
||||
late final GetStorage? _storage;
|
||||
late final String originalDll;
|
||||
late final TextEditingController gameServerDll;
|
||||
late final TextEditingController unrealEngineConsoleDll;
|
||||
late final TextEditingController backendDll;
|
||||
late final TextEditingController memoryLeakDll;
|
||||
late final TextEditingController gameServerPort;
|
||||
late final Rx<UpdateTimer> timer;
|
||||
late final TextEditingController url;
|
||||
late final RxBool customGameServer;
|
||||
late final RxnInt timestamp;
|
||||
late final Rx<UpdateStatus> status;
|
||||
InfoBarEntry? infoBarEntry;
|
||||
Future<bool>? _updater;
|
||||
|
||||
DllController() {
|
||||
_storage = appWithNoStorage ? null : GetStorage(storageName);
|
||||
gameServerDll = _createController("game_server", InjectableDll.reboot);
|
||||
unrealEngineConsoleDll = _createController("unreal_engine_console", InjectableDll.console);
|
||||
backendDll = _createController("backend", InjectableDll.cobalt);
|
||||
memoryLeakDll = _createController("memory_leak", InjectableDll.memory);
|
||||
gameServerPort = TextEditingController(text: _storage?.read("game_server_port") ?? kDefaultGameServerPort);
|
||||
gameServerPort.addListener(() => _storage?.write("game_server_port", gameServerPort.text));
|
||||
final timerIndex = _storage?.read("timer");
|
||||
timer = Rx(timerIndex == null ? UpdateTimer.hour : UpdateTimer.values.elementAt(timerIndex));
|
||||
timer.listen((value) => _storage?.write("timer", value.index));
|
||||
url = TextEditingController(text: _storage?.read("update_url") ?? kRebootDownloadUrl);
|
||||
url.addListener(() => _storage?.write("update_url", url.text));
|
||||
status = Rx(UpdateStatus.waiting);
|
||||
customGameServer = RxBool(_storage?.read("custom_game_server") ?? false);
|
||||
customGameServer.listen((value) => _storage?.write("custom_game_server", value));
|
||||
timestamp = RxnInt(_storage?.read("ts"));
|
||||
timestamp.listen((value) => _storage?.write("ts", value));
|
||||
}
|
||||
|
||||
TextEditingController _createController(String key, InjectableDll dll) {
|
||||
final controller = TextEditingController(text: _storage?.read(key) ?? getDefaultDllPath(dll));
|
||||
controller.addListener(() => _storage?.write(key, controller.text));
|
||||
return controller;
|
||||
}
|
||||
|
||||
void resetGame() {
|
||||
gameServerDll.text = getDefaultDllPath(InjectableDll.reboot);
|
||||
unrealEngineConsoleDll.text = getDefaultDllPath(InjectableDll.console);
|
||||
backendDll.text = getDefaultDllPath(InjectableDll.cobalt);
|
||||
memoryLeakDll.text = getDefaultDllPath(InjectableDll.memory);
|
||||
}
|
||||
|
||||
void resetServer() {
|
||||
gameServerPort.text = kDefaultGameServerPort;
|
||||
timer.value = UpdateTimer.hour;
|
||||
url.text = kRebootDownloadUrl;
|
||||
status.value = UpdateStatus.waiting;
|
||||
customGameServer.value = false;
|
||||
timestamp.value = null;
|
||||
updateGameServerDll();
|
||||
}
|
||||
|
||||
Future<bool> updateGameServerDll({bool force = false, bool silent = false}) async {
|
||||
if(_updater != null) {
|
||||
return await _updater!;
|
||||
}
|
||||
|
||||
final result = _updateGameServerDll(force, silent);
|
||||
_updater = result;
|
||||
return await result;
|
||||
}
|
||||
|
||||
Future<bool> _updateGameServerDll(bool force, bool silent) async {
|
||||
try {
|
||||
if(customGameServer.value) {
|
||||
status.value = UpdateStatus.success;
|
||||
return true;
|
||||
}
|
||||
|
||||
final needsUpdate = await hasRebootDllUpdate(
|
||||
timestamp.value,
|
||||
hours: timer.value.hours,
|
||||
force: force
|
||||
);
|
||||
if(!needsUpdate) {
|
||||
status.value = UpdateStatus.success;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!silent) {
|
||||
infoBarEntry = showRebootInfoBar(
|
||||
translations.downloadingDll("reboot"),
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
}
|
||||
timestamp.value = await downloadRebootDll(url.text);
|
||||
status.value = UpdateStatus.success;
|
||||
infoBarEntry?.close();
|
||||
if(!silent) {
|
||||
infoBarEntry = showRebootInfoBar(
|
||||
translations.downloadDllSuccess("reboot"),
|
||||
severity: InfoBarSeverity.success,
|
||||
duration: infoBarShortDuration
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}catch(message) {
|
||||
infoBarEntry?.close();
|
||||
var error = message.toString();
|
||||
error = error.contains(": ") ? error.substring(error.indexOf(": ") + 2) : error;
|
||||
error = error.toLowerCase();
|
||||
status.value = UpdateStatus.error;
|
||||
showRebootInfoBar(
|
||||
translations.downloadDllError("reboot.dll", error.toString()),
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error,
|
||||
action: Button(
|
||||
onPressed: () => updateGameServerDll(
|
||||
force: true,
|
||||
silent: silent
|
||||
),
|
||||
child: Text(translations.downloadDllRetry),
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}finally {
|
||||
_updater = null;
|
||||
}
|
||||
}
|
||||
|
||||
(File, bool) getInjectableData(InjectableDll dll) {
|
||||
final defaultPath = canonicalize(getDefaultDllPath(dll));
|
||||
switch(dll){
|
||||
case InjectableDll.reboot:
|
||||
if(customGameServer.value) {
|
||||
final file = File(gameServerDll.text);
|
||||
if(file.existsSync()) {
|
||||
return (file, true);
|
||||
}
|
||||
}
|
||||
|
||||
return (rebootDllFile, false);
|
||||
case InjectableDll.console:
|
||||
final ue4ConsoleFile = File(unrealEngineConsoleDll.text);
|
||||
return (ue4ConsoleFile, canonicalize(ue4ConsoleFile.path) != defaultPath);
|
||||
case InjectableDll.cobalt:
|
||||
final backendFile = File(backendDll.text);
|
||||
return (backendFile, canonicalize(backendFile.path) != defaultPath);
|
||||
case InjectableDll.memory:
|
||||
final memoryLeakFile = File(memoryLeakDll.text);
|
||||
return (memoryLeakFile, canonicalize(memoryLeakFile.path) != defaultPath);
|
||||
}
|
||||
}
|
||||
|
||||
String getDefaultDllPath(InjectableDll dll) => "${dllsDirectory.path}\\${dll.name}.dll";
|
||||
|
||||
Future<bool> downloadCriticalDllInteractive(String filePath, {bool silent = false, bool force = false}) async {
|
||||
log("[DLL] Asking for $filePath(silent: $silent)");
|
||||
final fileName = basename(filePath).toLowerCase();
|
||||
log("[DLL] File name: $fileName");
|
||||
InfoBarEntry? entry;
|
||||
try {
|
||||
if (fileName == "reboot.dll") {
|
||||
log("[DLL] Downloading reboot.dll...");
|
||||
return await updateGameServerDll(
|
||||
silent: silent
|
||||
);
|
||||
}
|
||||
|
||||
if(!force && File(filePath).existsSync()) {
|
||||
log("[DLL] File already exists");
|
||||
return true;
|
||||
}
|
||||
|
||||
final fileNameWithoutExtension = basenameWithoutExtension(filePath);
|
||||
if(!silent) {
|
||||
entry = showRebootInfoBar(
|
||||
translations.downloadingDll(fileNameWithoutExtension),
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
}
|
||||
await downloadCriticalDll(fileName, filePath);
|
||||
entry?.close();
|
||||
if(!silent) {
|
||||
entry = await showRebootInfoBar(
|
||||
translations.downloadDllSuccess(fileNameWithoutExtension),
|
||||
severity: InfoBarSeverity.success,
|
||||
duration: infoBarShortDuration
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}catch(message) {
|
||||
log("[DLL] Error: $message");
|
||||
entry?.close();
|
||||
var error = message.toString();
|
||||
error =
|
||||
error.contains(": ") ? error.substring(error.indexOf(": ") + 2) : error;
|
||||
error = error.toLowerCase();
|
||||
final completer = Completer();
|
||||
await showRebootInfoBar(
|
||||
translations.downloadDllError(fileName, error.toString()),
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error,
|
||||
onDismissed: () => completer.complete(null),
|
||||
action: Button(
|
||||
onPressed: () async {
|
||||
await downloadCriticalDllInteractive(filePath);
|
||||
completer.complete(null);
|
||||
},
|
||||
child: Text(translations.downloadDllRetry),
|
||||
)
|
||||
);
|
||||
await completer.future;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension _UpdateTimerExtension on UpdateTimer {
|
||||
int get hours {
|
||||
switch(this) {
|
||||
case UpdateTimer.never:
|
||||
return -1;
|
||||
case UpdateTimer.hour:
|
||||
return 1;
|
||||
case UpdateTimer.day:
|
||||
return 24;
|
||||
case UpdateTimer.week:
|
||||
return 24 * 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,14 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/src/util/keyboard.dart';
|
||||
|
||||
import '../../main.dart';
|
||||
import 'package:reboot_launcher/main.dart';
|
||||
|
||||
class GameController extends GetxController {
|
||||
static const PhysicalKeyboardKey _kDefaultConsoleKey = PhysicalKeyboardKey(0x00070041);
|
||||
static const String storageName = "game_storage";
|
||||
|
||||
late final GetStorage? _storage;
|
||||
late final TextEditingController username;
|
||||
@@ -22,10 +18,9 @@ class GameController extends GetxController {
|
||||
late final Rxn<FortniteVersion> _selectedVersion;
|
||||
late final RxBool started;
|
||||
late final Rxn<GameInstance> instance;
|
||||
late final Rx<PhysicalKeyboardKey> consoleKey;
|
||||
|
||||
GameController() {
|
||||
_storage = appWithNoStorage ? null : GetStorage("game_storage");
|
||||
_storage = appWithNoStorage ? null : GetStorage(storageName);
|
||||
Iterable decodedVersionsJson = jsonDecode(_storage?.read("versions") ?? "[]");
|
||||
final decodedVersions = decodedVersionsJson
|
||||
.map((entry) => FortniteVersion.fromJson(entry))
|
||||
@@ -41,41 +36,9 @@ class GameController extends GetxController {
|
||||
password = TextEditingController(text: _storage?.read("password") ?? "");
|
||||
password.addListener(() => _storage?.write("password", password.text));
|
||||
customLaunchArgs = TextEditingController(text: _storage?.read("custom_launch_args") ?? "");
|
||||
customLaunchArgs.addListener(() =>
|
||||
_storage?.write("custom_launch_args", customLaunchArgs.text));
|
||||
customLaunchArgs.addListener(() => _storage?.write("custom_launch_args", customLaunchArgs.text));
|
||||
started = RxBool(false);
|
||||
instance = Rxn();
|
||||
consoleKey = Rx(_readConsoleKey());
|
||||
_writeConsoleKey(consoleKey.value);
|
||||
consoleKey.listen((newValue) {
|
||||
_storage?.write("console_key", newValue.usbHidUsage);
|
||||
_writeConsoleKey(newValue);
|
||||
});
|
||||
}
|
||||
|
||||
PhysicalKeyboardKey _readConsoleKey() {
|
||||
final consoleKeyValue = _storage?.read("console_key");
|
||||
if(consoleKeyValue == null) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
final consoleKeyNumber = int.tryParse(consoleKeyValue.toString());
|
||||
if(consoleKeyNumber == null) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
final consoleKey = PhysicalKeyboardKey(consoleKeyNumber);
|
||||
if(!consoleKey.isUnrealEngineKey) {
|
||||
return _kDefaultConsoleKey;
|
||||
}
|
||||
|
||||
return consoleKey;
|
||||
}
|
||||
|
||||
Future<void> _writeConsoleKey(PhysicalKeyboardKey keyValue) async {
|
||||
final defaultInput = File("${backendDirectory.path}\\CloudStorage\\DefaultInput.ini");
|
||||
await defaultInput.parent.create(recursive: true);
|
||||
await defaultInput.writeAsString("[/Script/Engine.InputSettings]\n+ConsoleKeys=Tilde\n+ConsoleKeys=${keyValue.unrealEngineName}", flush: true);
|
||||
}
|
||||
|
||||
void reset() {
|
||||
@@ -83,6 +46,7 @@ class GameController extends GetxController {
|
||||
password.text = "";
|
||||
customLaunchArgs.text = "";
|
||||
versions.value = [];
|
||||
_selectedVersion.value = null;
|
||||
instance.value = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import 'package:sync/semaphore.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class HostingController extends GetxController {
|
||||
static const String storageName = "hosting_storage";
|
||||
|
||||
late final GetStorage? _storage;
|
||||
late final String uuid;
|
||||
late final TextEditingController name;
|
||||
@@ -28,10 +30,11 @@ class HostingController extends GetxController {
|
||||
late final RxBool published;
|
||||
late final Rxn<GameInstance> instance;
|
||||
late final Rxn<Set<FortniteServer>> servers;
|
||||
late final TextEditingController customLaunchArgs;
|
||||
late final Semaphore _semaphore;
|
||||
|
||||
HostingController() {
|
||||
_storage = appWithNoStorage ? null : GetStorage("hosting_storage");
|
||||
_storage = appWithNoStorage ? null : GetStorage(storageName);
|
||||
uuid = _storage?.read("uuid") ?? const Uuid().v4();
|
||||
_storage?.write("uuid", uuid);
|
||||
name = TextEditingController(text: _storage?.read("name"));
|
||||
@@ -62,6 +65,8 @@ class HostingController extends GetxController {
|
||||
servers.value = event;
|
||||
published.value = event.any((element) => element.id == uuid);
|
||||
});
|
||||
customLaunchArgs = TextEditingController(text: _storage?.read("custom_launch_args") ?? "");
|
||||
customLaunchArgs.addListener(() => _storage?.write("custom_launch_args", customLaunchArgs.text));
|
||||
_semaphore = Semaphore();
|
||||
}
|
||||
|
||||
@@ -135,10 +140,10 @@ class HostingController extends GetxController {
|
||||
description.text = "";
|
||||
showPassword.value = false;
|
||||
discoverable.value = false;
|
||||
started.value = false;
|
||||
instance.value = null;
|
||||
type.value = GameServerType.headless;
|
||||
autoRestart.value = true;
|
||||
customLaunchArgs.text = "";
|
||||
}
|
||||
|
||||
FortniteServer? findServerById(String uuid) {
|
||||
|
||||
@@ -15,37 +15,20 @@ import 'package:version/version.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
class SettingsController extends GetxController {
|
||||
static const String storageName = "settings_storage";
|
||||
|
||||
late final GetStorage? _storage;
|
||||
late final String originalDll;
|
||||
late final TextEditingController gameServerDll;
|
||||
late final TextEditingController unrealEngineConsoleDll;
|
||||
late final TextEditingController backendDll;
|
||||
late final TextEditingController memoryLeakDll;
|
||||
late final TextEditingController gameServerPort;
|
||||
late final RxString language;
|
||||
late final Rx<ThemeMode> themeMode;
|
||||
late final RxnInt timestamp;
|
||||
late final Rx<UpdateStatus> status;
|
||||
late final Rx<UpdateTimer> timer;
|
||||
late final TextEditingController url;
|
||||
late final RxBool customGameServer;
|
||||
late final RxBool firstRun;
|
||||
late final Map<String, Future<bool>> _operations;
|
||||
late final RxBool debug;
|
||||
late double width;
|
||||
late double height;
|
||||
late double? offsetX;
|
||||
late double? offsetY;
|
||||
InfoBarEntry? infoBarEntry;
|
||||
Future<bool>? _updater;
|
||||
|
||||
SettingsController() {
|
||||
_storage = appWithNoStorage ? null : GetStorage("settings_storage");
|
||||
gameServerDll = _createController("game_server", InjectableDll.reboot);
|
||||
unrealEngineConsoleDll = _createController("unreal_engine_console", InjectableDll.console);
|
||||
backendDll = _createController("backend", InjectableDll.cobalt);
|
||||
memoryLeakDll = _createController("memory_leak", InjectableDll.memory);
|
||||
gameServerPort = TextEditingController(text: _storage?.read("game_server_port") ?? kDefaultGameServerPort);
|
||||
gameServerPort.addListener(() => _storage?.write("game_server_port", gameServerPort.text));
|
||||
_storage = appWithNoStorage ? null : GetStorage(storageName);
|
||||
width = _storage?.read("width") ?? kDefaultWindowWidth;
|
||||
height = _storage?.read("height") ?? kDefaultWindowHeight;
|
||||
offsetX = _storage?.read("offset_x");
|
||||
@@ -54,25 +37,9 @@ class SettingsController extends GetxController {
|
||||
themeMode.listen((value) => _storage?.write("theme", value.index));
|
||||
language = RxString(_storage?.read("language") ?? currentLocale);
|
||||
language.listen((value) => _storage?.write("language", value));
|
||||
timestamp = RxnInt(_storage?.read("ts"));
|
||||
timestamp.listen((value) => _storage?.write("ts", value));
|
||||
final timerIndex = _storage?.read("timer");
|
||||
timer = Rx(timerIndex == null ? UpdateTimer.hour : UpdateTimer.values.elementAt(timerIndex));
|
||||
timer.listen((value) => _storage?.write("timer", value.index));
|
||||
url = TextEditingController(text: _storage?.read("update_url") ?? kRebootDownloadUrl);
|
||||
url.addListener(() => _storage?.write("update_url", url.text));
|
||||
status = Rx(UpdateStatus.waiting);
|
||||
customGameServer = RxBool(_storage?.read("custom_game_server") ?? false);
|
||||
customGameServer.listen((value) => _storage?.write("custom_game_server", value));
|
||||
firstRun = RxBool(_storage?.read("first_run_tutorial") ?? true);
|
||||
firstRun.listen((value) => _storage?.write("first_run_tutorial", value));
|
||||
_operations = {};
|
||||
}
|
||||
|
||||
TextEditingController _createController(String key, InjectableDll dll) {
|
||||
final controller = TextEditingController(text: _storage?.read(key) ?? _getDefaultPath(dll));
|
||||
controller.addListener(() => _storage?.write(key, controller.text));
|
||||
return controller;
|
||||
debug = RxBool(false);
|
||||
}
|
||||
|
||||
void saveWindowSize(Size size) {
|
||||
@@ -87,32 +54,18 @@ class SettingsController extends GetxController {
|
||||
_storage?.write("offset_y", offsetY);
|
||||
}
|
||||
|
||||
void reset(){
|
||||
gameServerDll.text = _getDefaultPath(InjectableDll.reboot);
|
||||
unrealEngineConsoleDll.text = _getDefaultPath(InjectableDll.console);
|
||||
backendDll.text = _getDefaultPath(InjectableDll.cobalt);
|
||||
memoryLeakDll.text = _getDefaultPath(InjectableDll.memory);
|
||||
gameServerPort.text = kDefaultGameServerPort;
|
||||
timestamp.value = null;
|
||||
timer.value = UpdateTimer.never;
|
||||
url.text = kRebootDownloadUrl;
|
||||
status.value = UpdateStatus.waiting;
|
||||
customGameServer.value = false;
|
||||
updateReboot();
|
||||
}
|
||||
|
||||
Future<void> notifyLauncherUpdate() async {
|
||||
if(appVersion == null) {
|
||||
if (appVersion == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final pubspec = await _getPubspecYaml();
|
||||
if(pubspec == null) {
|
||||
if (pubspec == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final latestVersion = Version.parse(pubspec["version"]);
|
||||
if(latestVersion <= appVersion) {
|
||||
if (latestVersion <= appVersion) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,7 +78,8 @@ class SettingsController extends GetxController {
|
||||
child: Text(translations.updateAvailableAction),
|
||||
onPressed: () {
|
||||
infoBar.close();
|
||||
launchUrl(Uri.parse("https://github.com/Auties00/reboot_launcher/releases"));
|
||||
launchUrl(Uri.parse(
|
||||
"https://github.com/Auties00/reboot_launcher/releases"));
|
||||
},
|
||||
)
|
||||
);
|
||||
@@ -133,201 +87,16 @@ class SettingsController extends GetxController {
|
||||
|
||||
Future<dynamic> _getPubspecYaml() async {
|
||||
try {
|
||||
final pubspecResponse = await http.get(Uri.parse("https://raw.githubusercontent.com/Auties00/reboot_launcher/master/gui/pubspec.yaml"));
|
||||
if(pubspecResponse.statusCode != 200) {
|
||||
final pubspecResponse = await http.get(Uri.parse(
|
||||
"https://raw.githubusercontent.com/Auties00/reboot_launcher/master/gui/pubspec.yaml"));
|
||||
if (pubspecResponse.statusCode != 200) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return loadYaml(pubspecResponse.body);
|
||||
}catch(error) {
|
||||
} catch (error) {
|
||||
log("[UPDATER] Cannot check for updates: $error");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> updateReboot({bool force = false, bool silent = false}) async {
|
||||
if(_updater != null) {
|
||||
return await _updater!;
|
||||
}
|
||||
|
||||
final result = _updateReboot(force, silent);
|
||||
_updater = result;
|
||||
return await result;
|
||||
}
|
||||
|
||||
Future<bool> _updateReboot(bool force, bool silent) async {
|
||||
try {
|
||||
if(customGameServer.value) {
|
||||
status.value = UpdateStatus.success;
|
||||
return true;
|
||||
}
|
||||
|
||||
final needsUpdate = await hasRebootDllUpdate(
|
||||
timestamp.value,
|
||||
hours: timer.value.hours,
|
||||
force: force
|
||||
);
|
||||
if(!needsUpdate) {
|
||||
status.value = UpdateStatus.success;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!silent) {
|
||||
infoBarEntry = showRebootInfoBar(
|
||||
translations.downloadingDll("reboot"),
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
}
|
||||
timestamp.value = await downloadRebootDll(url.text);
|
||||
status.value = UpdateStatus.success;
|
||||
infoBarEntry?.close();
|
||||
if(!silent) {
|
||||
infoBarEntry = showRebootInfoBar(
|
||||
translations.downloadDllSuccess("reboot"),
|
||||
severity: InfoBarSeverity.success,
|
||||
duration: infoBarShortDuration
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}catch(message) {
|
||||
infoBarEntry?.close();
|
||||
var error = message.toString();
|
||||
error = error.contains(": ") ? error.substring(error.indexOf(": ") + 2) : error;
|
||||
error = error.toLowerCase();
|
||||
status.value = UpdateStatus.error;
|
||||
showRebootInfoBar(
|
||||
translations.downloadDllError("reboot.dll", error.toString()),
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error,
|
||||
action: Button(
|
||||
onPressed: () => updateReboot(
|
||||
force: true,
|
||||
silent: silent
|
||||
),
|
||||
child: Text(translations.downloadDllRetry),
|
||||
)
|
||||
);
|
||||
return false;
|
||||
}finally {
|
||||
_updater = null;
|
||||
}
|
||||
}
|
||||
|
||||
(File, bool) getInjectableData(InjectableDll dll) {
|
||||
final defaultPath = canonicalize(_getDefaultPath(dll));
|
||||
switch(dll){
|
||||
case InjectableDll.reboot:
|
||||
if(customGameServer.value) {
|
||||
final file = File(gameServerDll.text);
|
||||
if(file.existsSync()) {
|
||||
return (file, true);
|
||||
}
|
||||
}
|
||||
|
||||
return (rebootDllFile, false);
|
||||
case InjectableDll.console:
|
||||
final ue4ConsoleFile = File(unrealEngineConsoleDll.text);
|
||||
return (ue4ConsoleFile, canonicalize(ue4ConsoleFile.path) != defaultPath);
|
||||
case InjectableDll.cobalt:
|
||||
final backendFile = File(backendDll.text);
|
||||
return (backendFile, canonicalize(backendFile.path) != defaultPath);
|
||||
case InjectableDll.memory:
|
||||
final memoryLeakFile = File(memoryLeakDll.text);
|
||||
return (memoryLeakFile, canonicalize(memoryLeakFile.path) != defaultPath);
|
||||
}
|
||||
}
|
||||
|
||||
String _getDefaultPath(InjectableDll dll) => "${dllsDirectory.path}\\${dll.name}.dll";
|
||||
|
||||
Future<bool> downloadCriticalDllInteractive(String filePath, {bool silent = false}) {
|
||||
log("[DLL] Asking for $filePath(silent: $silent)");
|
||||
final old = _operations[filePath];
|
||||
if(old != null) {
|
||||
log("[DLL] Download task already exists");
|
||||
return old;
|
||||
}
|
||||
|
||||
log("[DLL] Creating new download task...");
|
||||
final newRun = _downloadCriticalDllInteractive(filePath, silent);
|
||||
_operations[filePath] = newRun;
|
||||
return newRun;
|
||||
}
|
||||
|
||||
Future<bool> _downloadCriticalDllInteractive(String filePath, bool silent) async {
|
||||
final fileName = basename(filePath).toLowerCase();
|
||||
log("[DLL] File name: $fileName");
|
||||
InfoBarEntry? entry;
|
||||
try {
|
||||
if (fileName == "reboot.dll") {
|
||||
log("[DLL] Downloading reboot.dll...");
|
||||
return await updateReboot(
|
||||
silent: silent
|
||||
);
|
||||
}
|
||||
|
||||
if(File(filePath).existsSync()) {
|
||||
log("[DLL] File already exists");
|
||||
return true;
|
||||
}
|
||||
|
||||
final fileNameWithoutExtension = basenameWithoutExtension(filePath);
|
||||
if(!silent) {
|
||||
entry = showRebootInfoBar(
|
||||
translations.downloadingDll(fileNameWithoutExtension),
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
}
|
||||
await downloadCriticalDll(fileName, filePath);
|
||||
entry?.close();
|
||||
if(!silent) {
|
||||
entry = await showRebootInfoBar(
|
||||
translations.downloadDllSuccess(fileNameWithoutExtension),
|
||||
severity: InfoBarSeverity.success,
|
||||
duration: infoBarShortDuration
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}catch(message) {
|
||||
log("[DLL] Error: $message");
|
||||
entry?.close();
|
||||
var error = message.toString();
|
||||
error = error.contains(": ") ? error.substring(error.indexOf(": ") + 2) : error;
|
||||
error = error.toLowerCase();
|
||||
final completer = Completer();
|
||||
await showRebootInfoBar(
|
||||
translations.downloadDllError(fileName, error.toString()),
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error,
|
||||
onDismissed: () => completer.complete(null),
|
||||
action: Button(
|
||||
onPressed: () async {
|
||||
await downloadCriticalDllInteractive(filePath);
|
||||
completer.complete(null);
|
||||
},
|
||||
child: Text(translations.downloadDllRetry),
|
||||
)
|
||||
);
|
||||
await completer.future;
|
||||
return false;
|
||||
}finally {
|
||||
_operations.remove(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension _UpdateTimerExtension on UpdateTimer {
|
||||
int get hours {
|
||||
switch(this) {
|
||||
case UpdateTimer.never:
|
||||
return -1;
|
||||
case UpdateTimer.hour:
|
||||
return 1;
|
||||
case UpdateTimer.day:
|
||||
return 24;
|
||||
case UpdateTimer.week:
|
||||
return 24 * 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,19 +23,18 @@ InfoBarEntry showRebootInfoBar(dynamic text, {
|
||||
|
||||
Widget _buildOverlay(text, Widget? action, bool loading, InfoBarSeverity severity) => ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minWidth: double.infinity,
|
||||
minHeight: _height
|
||||
),
|
||||
child: Mica(
|
||||
elevation: 1,
|
||||
child: InfoBar(
|
||||
title: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if(text is Widget)
|
||||
text,
|
||||
if(text is String)
|
||||
Text(text),
|
||||
Expanded(
|
||||
child: text is Widget ? text : Text(text)
|
||||
),
|
||||
if(action != null)
|
||||
action
|
||||
],
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:email_validator/email_validator.dart';
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:flutter/material.dart' show Icons;
|
||||
import 'package:get/get.dart';
|
||||
@@ -23,6 +24,17 @@ Future<bool> showProfileForm(BuildContext context) async{
|
||||
label: translations.usernameOrEmail,
|
||||
child: TextFormBox(
|
||||
placeholder: translations.usernameOrEmailPlaceholder,
|
||||
validator: (text) {
|
||||
if(_gameController.password.text.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(EmailValidator.validate(_gameController.username.text)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return translations.invalidEmail;
|
||||
},
|
||||
controller: _gameController.username,
|
||||
autovalidateMode: AutovalidateMode.always,
|
||||
enableSuggestions: true,
|
||||
|
||||
@@ -15,10 +15,40 @@ import 'package:reboot_launcher/src/page/pages.dart';
|
||||
import 'package:reboot_launcher/src/util/cryptography.dart';
|
||||
import 'package:reboot_launcher/src/util/matchmaker.dart';
|
||||
import 'package:reboot_launcher/src/util/translations.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
final List<InfoBarEntry> _infoBars = [];
|
||||
|
||||
extension ServerControllerDialog on BackendController {
|
||||
void cancelInteractive() {
|
||||
worker?.cancel(); // Do not await or it will hang
|
||||
_infoBars.forEach((infoBar) => infoBar.close());
|
||||
_infoBars.clear();
|
||||
}
|
||||
|
||||
Future<bool> toggleInteractive() async {
|
||||
final stream = toggle();
|
||||
cancelInteractive();
|
||||
final stream = toggle(
|
||||
onExit: () {
|
||||
cancelInteractive();
|
||||
_showRebootInfoBar(
|
||||
translations.backendProcessError,
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
},
|
||||
onError: (errorMessage) {
|
||||
cancelInteractive();
|
||||
_showRebootInfoBar(
|
||||
translations.backendErrorMessage,
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration,
|
||||
action: Button(
|
||||
onPressed: () => launchUrl(launcherLogFile.uri),
|
||||
child: Text(translations.openLog),
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
final completer = Completer<bool>();
|
||||
InfoBarEntry? entry;
|
||||
worker = stream.listen((event) {
|
||||
@@ -38,105 +68,100 @@ extension ServerControllerDialog on BackendController {
|
||||
log("[BACKEND] Handling event: $event");
|
||||
switch (event.type) {
|
||||
case ServerResultType.starting:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.startingServer,
|
||||
severity: InfoBarSeverity.info,
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
case ServerResultType.startSuccess:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
type.value == ServerType.local ? translations.checkedServer : translations.startedServer,
|
||||
severity: InfoBarSeverity.success
|
||||
);
|
||||
case ServerResultType.startError:
|
||||
print(event.stackTrace);
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
type.value == ServerType.local ? translations.localServerError(event.error ?? translations.unknownError) : translations.startServerError(event.error ?? translations.unknownError),
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration
|
||||
);
|
||||
case ServerResultType.stopping:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.stoppingServer,
|
||||
severity: InfoBarSeverity.info,
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
case ServerResultType.stopSuccess:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.stoppedServer,
|
||||
severity: InfoBarSeverity.success
|
||||
);
|
||||
case ServerResultType.stopError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.stopServerError(event.error ?? translations.unknownError),
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration
|
||||
);
|
||||
case ServerResultType.missingHostError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.missingHostNameError,
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
case ServerResultType.missingPortError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.missingPortError,
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
case ServerResultType.illegalPortError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.illegalPortError,
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
case ServerResultType.freeingPort:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.freeingPort,
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
case ServerResultType.freePortSuccess:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.freedPort,
|
||||
severity: InfoBarSeverity.success,
|
||||
duration: infoBarShortDuration
|
||||
);
|
||||
case ServerResultType.freePortError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.freePortError(event.error ?? translations.unknownError),
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration
|
||||
);
|
||||
case ServerResultType.pingingRemote:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.pingingServer(ServerType.remote.name),
|
||||
severity: InfoBarSeverity.info,
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
case ServerResultType.pingingLocal:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.pingingServer(type.value.name),
|
||||
severity: InfoBarSeverity.info,
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
case ServerResultType.pingError:
|
||||
return showRebootInfoBar(
|
||||
return _showRebootInfoBar(
|
||||
translations.pingError(type.value.name),
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
case ServerResultType.processError:
|
||||
return showRebootInfoBar(
|
||||
translations.backendProcessError,
|
||||
severity: InfoBarSeverity.error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> joinServerInteractive(String uuid, FortniteServer server) async {
|
||||
if(!kDebugMode && uuid == server.id) {
|
||||
showRebootInfoBar(
|
||||
_showRebootInfoBar(
|
||||
translations.joinSelfServer,
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error
|
||||
@@ -147,7 +172,7 @@ extension ServerControllerDialog on BackendController {
|
||||
final gameController = Get.find<GameController>();
|
||||
final version = gameController.getVersionByName(server.version.toString());
|
||||
if(version == null) {
|
||||
showRebootInfoBar(
|
||||
_showRebootInfoBar(
|
||||
translations.cannotJoinServerVersion(server.version.toString()),
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error
|
||||
@@ -176,7 +201,7 @@ extension ServerControllerDialog on BackendController {
|
||||
}
|
||||
|
||||
if(!checkPassword(confirmPassword, hashedPassword)) {
|
||||
showRebootInfoBar(
|
||||
_showRebootInfoBar(
|
||||
translations.wrongServerPassword,
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error
|
||||
@@ -199,7 +224,7 @@ extension ServerControllerDialog on BackendController {
|
||||
return true;
|
||||
}
|
||||
|
||||
showRebootInfoBar(
|
||||
_showRebootInfoBar(
|
||||
translations.offlineServer,
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.error
|
||||
@@ -268,10 +293,31 @@ extension ServerControllerDialog on BackendController {
|
||||
FlutterClipboard.controlC(decryptedIp);
|
||||
}
|
||||
controller.selectedVersion = version;
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => showRebootInfoBar(
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => _showRebootInfoBar(
|
||||
embedded ? translations.joinedServer(author) : translations.copiedIp,
|
||||
duration: infoBarLongDuration,
|
||||
severity: InfoBarSeverity.success
|
||||
));
|
||||
}
|
||||
|
||||
InfoBarEntry _showRebootInfoBar(dynamic text, {
|
||||
InfoBarSeverity severity = InfoBarSeverity.info,
|
||||
bool loading = false,
|
||||
Duration? duration = infoBarShortDuration,
|
||||
void Function()? onDismissed,
|
||||
Widget? action
|
||||
}) {
|
||||
final result = showRebootInfoBar(
|
||||
text,
|
||||
severity: severity,
|
||||
loading: loading,
|
||||
duration: duration,
|
||||
onDismissed: onDismissed,
|
||||
action: action
|
||||
);
|
||||
if(severity == InfoBarSeverity.info || severity == InfoBarSeverity.success) {
|
||||
_infoBars.add(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/onboard.dart';
|
||||
import 'package:reboot_launcher/src/page/abstract/page_type.dart';
|
||||
import 'package:reboot_launcher/src/util/translations.dart';
|
||||
|
||||
abstract class RebootPage extends StatefulWidget {
|
||||
const RebootPage({super.key});
|
||||
@@ -19,15 +24,32 @@ abstract class RebootPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
abstract class RebootPageState<T extends RebootPage> extends State<T> with AutomaticKeepAliveClientMixin<T> {
|
||||
final SettingsController _settingsController = Get.find<SettingsController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
var buttonWidget = button;
|
||||
if(buttonWidget == null) {
|
||||
return _listView;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildFirstLaunchInfo(),
|
||||
_buildDebugInfo(),
|
||||
Expanded(
|
||||
child: _listView
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildFirstLaunchInfo(),
|
||||
_buildDebugInfo(),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _listView,
|
||||
@@ -42,9 +64,70 @@ abstract class RebootPageState<T extends RebootPage> extends State<T> with Autom
|
||||
child: buttonWidget
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFirstLaunchInfo() => Obx(() {
|
||||
if(!_settingsController.firstRun.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 8.0
|
||||
),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: InfoBar(
|
||||
title: Text(translations.welcomeTitle),
|
||||
severity: InfoBarSeverity.warning,
|
||||
isLong: true,
|
||||
content: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(translations.welcomeDescription)
|
||||
),
|
||||
action: Button(
|
||||
child: Text(translations.welcomeAction),
|
||||
onPressed: () => startOnboarding(),
|
||||
),
|
||||
onClose: () => _settingsController.firstRun.value = false
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Widget _buildDebugInfo() => Obx(() {
|
||||
if(!_settingsController.debug.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 8.0
|
||||
),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: InfoBar(
|
||||
title: Text("Debug mode is enabled"),
|
||||
severity: InfoBarSeverity.warning,
|
||||
isLong: true,
|
||||
content: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text( "• Automatic dll injection is disabled\n"
|
||||
"• The game server cannot start automatically\n"
|
||||
"• The game server runs in a normal window")
|
||||
),
|
||||
onClose: () {
|
||||
_settingsController.debug.value = false;
|
||||
},
|
||||
),
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
ListView get _listView => ListView.builder(
|
||||
itemCount: settings.length,
|
||||
itemBuilder: (context, index) => settings[index],
|
||||
|
||||
@@ -43,7 +43,6 @@ class BackendPage extends RebootPage {
|
||||
}
|
||||
|
||||
class _BackendPageState extends RebootPageState<BackendPage> {
|
||||
final GameController _gameController = Get.find<GameController>();
|
||||
final BackendController _backendController = Get.find<BackendController>();
|
||||
|
||||
InfoBarEntry? _infoBarEntry;
|
||||
@@ -56,7 +55,7 @@ class _BackendPageState extends RebootPageState<BackendPage> {
|
||||
}
|
||||
|
||||
if(keyEvent.physicalKey.isUnrealEngineKey) {
|
||||
_gameController.consoleKey.value = keyEvent.physicalKey;
|
||||
_backendController.consoleKey.value = keyEvent.physicalKey;
|
||||
}
|
||||
|
||||
_infoBarEntry?.close();
|
||||
@@ -194,7 +193,7 @@ class _BackendPageState extends RebootPageState<BackendPage> {
|
||||
duration: null
|
||||
);
|
||||
},
|
||||
child: Text(_gameController.consoleKey.value.unrealEnginePrettyName ?? ""),
|
||||
child: Text(_backendController.consoleKey.value.unrealEnginePrettyName ?? ""),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:flutter/material.dart' show MaterialPage;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/src/controller/backend_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/dll_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/hosting_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
import 'package:reboot_launcher/src/messenger/abstract/dialog.dart';
|
||||
@@ -44,6 +45,7 @@ class _HomePageState extends State<HomePage> with WindowListener, AutomaticKeepA
|
||||
final BackendController _backendController = Get.find<BackendController>();
|
||||
final HostingController _hostingController = Get.find<HostingController>();
|
||||
final SettingsController _settingsController = Get.find<SettingsController>();
|
||||
final DllController _dllController = Get.find<DllController>();
|
||||
final GlobalKey _searchKey = GlobalKey();
|
||||
final FocusNode _searchFocusNode = FocusNode();
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
@@ -134,9 +136,9 @@ class _HomePageState extends State<HomePage> with WindowListener, AutomaticKeepA
|
||||
}
|
||||
|
||||
for(final injectable in InjectableDll.values) {
|
||||
final (file, custom) = _settingsController.getInjectableData(injectable);
|
||||
final (file, custom) = _dllController.getInjectableData(injectable);
|
||||
if(!custom) {
|
||||
_settingsController.downloadCriticalDllInteractive(
|
||||
_dllController.downloadCriticalDllInteractive(
|
||||
file.path,
|
||||
silent: true
|
||||
);
|
||||
@@ -144,7 +146,7 @@ class _HomePageState extends State<HomePage> with WindowListener, AutomaticKeepA
|
||||
}
|
||||
|
||||
watchDlls().listen((filePath) => showDllDeletedDialog(() {
|
||||
_settingsController.downloadCriticalDllInteractive(filePath);
|
||||
_dllController.downloadCriticalDllInteractive(filePath);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/main.dart';
|
||||
import 'package:reboot_launcher/src/controller/dll_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/game_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/hosting_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
@@ -53,6 +54,7 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
final GameController _gameController = Get.find<GameController>();
|
||||
final HostingController _hostingController = Get.find<HostingController>();
|
||||
final SettingsController _settingsController = Get.find<SettingsController>();
|
||||
final DllController _dllController = Get.find<DllController>();
|
||||
|
||||
late final RxBool _showPasswordTrailing = RxBool(_hostingController.password.text.isNotEmpty);
|
||||
|
||||
@@ -199,6 +201,17 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
title: Text(translations.settingsServerOptionsName),
|
||||
subtitle: Text(translations.settingsServerOptionsSubtitle),
|
||||
children: [
|
||||
SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.options_24_regular
|
||||
),
|
||||
title: Text(translations.settingsClientArgsName),
|
||||
subtitle: Text(translations.settingsClientArgsDescription),
|
||||
content: TextFormBox(
|
||||
placeholder: translations.settingsClientArgsPlaceholder,
|
||||
controller: _hostingController.customLaunchArgs,
|
||||
)
|
||||
),
|
||||
SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.window_console_20_regular
|
||||
@@ -208,11 +221,12 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
content: Obx(() => DropDownButton(
|
||||
onOpen: () => inDialog = true,
|
||||
onClose: () => inDialog = false,
|
||||
leading: Text(_hostingController.type.value.translatedName),
|
||||
leading: Text(_settingsController.debug.value ? GameServerType.window.translatedName : _hostingController.type.value.translatedName),
|
||||
items: GameServerType.values.map((entry) => MenuFlyoutItem(
|
||||
text: Text(entry.translatedName),
|
||||
onPressed: () => _hostingController.type.value = entry
|
||||
)).toList()
|
||||
)).toList(),
|
||||
disabled: _settingsController.debug.value
|
||||
)),
|
||||
),
|
||||
SettingTile(
|
||||
@@ -246,14 +260,14 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
contentWidth: 64,
|
||||
content: TextFormBox(
|
||||
placeholder: translations.settingsServerPortName,
|
||||
controller: _settingsController.gameServerPort,
|
||||
controller: _dllController.gameServerPort,
|
||||
keyboardType: TextInputType.number,
|
||||
textAlign: TextAlign.center,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly
|
||||
]
|
||||
)
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
||||
@@ -273,22 +287,22 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
content: Obx(() => DropDownButton(
|
||||
onOpen: () => inDialog = true,
|
||||
onClose: () => inDialog = false,
|
||||
leading: Text(_settingsController.customGameServer.value ? translations.settingsServerTypeCustomName : translations.settingsServerTypeEmbeddedName),
|
||||
leading: Text(_dllController.customGameServer.value ? translations.settingsServerTypeCustomName : translations.settingsServerTypeEmbeddedName),
|
||||
items: {
|
||||
false: translations.settingsServerTypeEmbeddedName,
|
||||
true: translations.settingsServerTypeCustomName
|
||||
}.entries.map((entry) => MenuFlyoutItem(
|
||||
text: Text(entry.value),
|
||||
onPressed: () {
|
||||
final oldValue = _settingsController.customGameServer.value;
|
||||
final oldValue = _dllController.customGameServer.value;
|
||||
if(oldValue == entry.key) {
|
||||
return;
|
||||
}
|
||||
|
||||
_settingsController.customGameServer.value = entry.key;
|
||||
_settingsController.infoBarEntry?.close();
|
||||
_dllController.customGameServer.value = entry.key;
|
||||
_dllController.infoBarEntry?.close();
|
||||
if(!entry.key) {
|
||||
_settingsController.updateReboot(
|
||||
_dllController.updateGameServerDll(
|
||||
force: true
|
||||
);
|
||||
}
|
||||
@@ -297,18 +311,23 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
))
|
||||
),
|
||||
Obx(() {
|
||||
if(!_settingsController.customGameServer.value) {
|
||||
if(!_dllController.customGameServer.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return createFileSetting(
|
||||
title: translations.settingsServerFileName,
|
||||
description: translations.settingsServerFileDescription,
|
||||
controller: _settingsController.gameServerDll
|
||||
controller: _dllController.gameServerDll,
|
||||
onReset: () {
|
||||
final path = _dllController.getDefaultDllPath(InjectableDll.reboot);
|
||||
_dllController.gameServerDll.text = path;
|
||||
_dllController.downloadCriticalDllInteractive(path);
|
||||
}
|
||||
);
|
||||
}),
|
||||
Obx(() {
|
||||
if(_settingsController.customGameServer.value) {
|
||||
if(_dllController.customGameServer.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -318,15 +337,34 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
),
|
||||
title: Text(translations.settingsServerMirrorName),
|
||||
subtitle: Text(translations.settingsServerMirrorDescription),
|
||||
content: TextFormBox(
|
||||
content: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextFormBox(
|
||||
placeholder: translations.settingsServerMirrorPlaceholder,
|
||||
controller: _settingsController.url,
|
||||
controller: _dllController.url,
|
||||
validator: _checkUpdateUrl
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8.0),
|
||||
Button(
|
||||
style: ButtonStyle(
|
||||
padding: ButtonState.all(EdgeInsets.zero)
|
||||
),
|
||||
onPressed: () => _dllController.url.text = kRebootDownloadUrl,
|
||||
child: SizedBox.square(
|
||||
dimension: 30,
|
||||
child: Icon(
|
||||
FluentIcons.arrow_reset_24_regular
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}),
|
||||
Obx(() {
|
||||
if(_settingsController.customGameServer.value) {
|
||||
if(_dllController.customGameServer.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -336,23 +374,44 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
),
|
||||
title: Text(translations.settingsServerTimerName),
|
||||
subtitle: Text(translations.settingsServerTimerSubtitle),
|
||||
content: Obx(() => DropDownButton(
|
||||
content: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Obx(() => DropDownButton(
|
||||
onOpen: () => inDialog = true,
|
||||
onClose: () => inDialog = false,
|
||||
leading: Text(_settingsController.timer.value.text),
|
||||
leading: Text(_dllController.timer.value.text),
|
||||
items: UpdateTimer.values.map((entry) => MenuFlyoutItem(
|
||||
text: Text(entry.text),
|
||||
onPressed: () {
|
||||
_settingsController.timer.value = entry;
|
||||
_settingsController.infoBarEntry?.close();
|
||||
_settingsController.updateReboot(
|
||||
_dllController.timer.value = entry;
|
||||
_dllController.infoBarEntry?.close();
|
||||
_dllController.updateGameServerDll(
|
||||
force: true
|
||||
);
|
||||
}
|
||||
)).toList()
|
||||
))
|
||||
)),
|
||||
),
|
||||
const SizedBox(width: 8.0),
|
||||
Button(
|
||||
style: ButtonStyle(
|
||||
padding: ButtonState.all(EdgeInsets.zero)
|
||||
),
|
||||
onPressed: () {
|
||||
_dllController.updateGameServerDll(force: true);
|
||||
},
|
||||
child: SizedBox.square(
|
||||
dimension: 30,
|
||||
child: Icon(
|
||||
FluentIcons.arrow_download_24_regular
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
)
|
||||
);
|
||||
}),
|
||||
})
|
||||
],
|
||||
);
|
||||
|
||||
@@ -420,7 +479,10 @@ class _HostingPageState extends RebootPageState<HostPage> {
|
||||
title: Text(translations.hostResetName),
|
||||
subtitle: Text(translations.hostResetDescription),
|
||||
content: Button(
|
||||
onPressed: () => showResetDialog(_hostingController.reset),
|
||||
onPressed: () => showResetDialog(() {
|
||||
_hostingController.reset();
|
||||
_dllController.resetServer();
|
||||
}),
|
||||
child: Text(translations.hostResetContent),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart' hide FluentIcons;
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/src/controller/dll_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/game_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
import 'package:reboot_launcher/src/messenger/abstract/overlay.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/data.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/onboard.dart';
|
||||
import 'package:reboot_launcher/src/page/abstract/page.dart';
|
||||
import 'package:reboot_launcher/src/page/abstract/page_type.dart';
|
||||
@@ -37,48 +40,7 @@ class PlayPage extends RebootPage {
|
||||
class _PlayPageState extends RebootPageState<PlayPage> {
|
||||
final SettingsController _settingsController = Get.find<SettingsController>();
|
||||
final GameController _gameController = Get.find<GameController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildFirstLaunchInfo(),
|
||||
Expanded(
|
||||
child: super.build(context),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildFirstLaunchInfo() => Obx(() {
|
||||
if(!_settingsController.firstRun.value) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 8.0
|
||||
),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: InfoBar(
|
||||
title: Text(translations.welcomeTitle),
|
||||
severity: InfoBarSeverity.warning,
|
||||
isLong: true,
|
||||
content: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(translations.welcomeDescription)
|
||||
),
|
||||
action: Button(
|
||||
child: Text(translations.welcomeAction),
|
||||
onPressed: () => startOnboarding(),
|
||||
),
|
||||
onClose: () => _settingsController.firstRun.value = false
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
final DllController _dllController = Get.find<DllController>();
|
||||
|
||||
@override
|
||||
Widget? get button => LaunchButton(
|
||||
@@ -94,6 +56,7 @@ class _PlayPageState extends RebootPageState<PlayPage> {
|
||||
),
|
||||
_options,
|
||||
_internalFiles,
|
||||
_resetDefaults
|
||||
];
|
||||
|
||||
SettingTile get _internalFiles => SettingTile(
|
||||
@@ -106,17 +69,32 @@ class _PlayPageState extends RebootPageState<PlayPage> {
|
||||
createFileSetting(
|
||||
title: translations.settingsClientConsoleName,
|
||||
description: translations.settingsClientConsoleDescription,
|
||||
controller: _settingsController.unrealEngineConsoleDll
|
||||
controller: _dllController.unrealEngineConsoleDll,
|
||||
onReset: () {
|
||||
final path = _dllController.getDefaultDllPath(InjectableDll.console);
|
||||
_dllController.unrealEngineConsoleDll.text = path;
|
||||
_dllController.downloadCriticalDllInteractive(path, force: true);
|
||||
}
|
||||
),
|
||||
createFileSetting(
|
||||
title: translations.settingsClientAuthName,
|
||||
description: translations.settingsClientAuthDescription,
|
||||
controller: _settingsController.backendDll
|
||||
controller: _dllController.backendDll,
|
||||
onReset: () {
|
||||
final path = _dllController.getDefaultDllPath(InjectableDll.cobalt);
|
||||
_dllController.backendDll.text = path;
|
||||
_dllController.downloadCriticalDllInteractive(path, force: true);
|
||||
}
|
||||
),
|
||||
createFileSetting(
|
||||
title: translations.settingsClientMemoryName,
|
||||
description: translations.settingsClientMemoryDescription,
|
||||
controller: _settingsController.memoryLeakDll
|
||||
controller: _dllController.memoryLeakDll,
|
||||
onReset: () {
|
||||
final path = _dllController.getDefaultDllPath(InjectableDll.memory);
|
||||
_dllController.memoryLeakDll.text = path;
|
||||
_dllController.downloadCriticalDllInteractive(path, force: true);
|
||||
}
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -141,4 +119,19 @@ class _PlayPageState extends RebootPageState<PlayPage> {
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
SettingTile get _resetDefaults => SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.arrow_reset_24_regular
|
||||
),
|
||||
title: Text(translations.gameResetDefaultsName),
|
||||
subtitle: Text(translations.gameResetDefaultsDescription),
|
||||
content: Button(
|
||||
onPressed: () => showResetDialog(() {
|
||||
_gameController.reset();
|
||||
_dllController.resetGame();
|
||||
}),
|
||||
child: Text(translations.gameResetDefaultsContent),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -42,8 +42,8 @@ class _SettingsPageState extends RebootPageState<SettingsPage> {
|
||||
List<Widget> get settings => [
|
||||
_language,
|
||||
_theme,
|
||||
_resetDefaults,
|
||||
_installationDirectory
|
||||
_debugMode,
|
||||
_installationDirectory,
|
||||
];
|
||||
|
||||
SettingTile get _language => SettingTile(
|
||||
@@ -89,18 +89,6 @@ class _SettingsPageState extends RebootPageState<SettingsPage> {
|
||||
))
|
||||
);
|
||||
|
||||
SettingTile get _resetDefaults => SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.arrow_reset_24_regular
|
||||
),
|
||||
title: Text(translations.settingsUtilsResetDefaultsName),
|
||||
subtitle: Text(translations.settingsUtilsResetDefaultsSubtitle),
|
||||
content: Button(
|
||||
onPressed: () => showResetDialog(_settingsController.reset),
|
||||
child: Text(translations.settingsUtilsResetDefaultsContent),
|
||||
)
|
||||
);
|
||||
|
||||
SettingTile get _installationDirectory => SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.folder_24_regular
|
||||
@@ -112,6 +100,29 @@ class _SettingsPageState extends RebootPageState<SettingsPage> {
|
||||
child: Text(translations.settingsUtilsInstallationDirectoryContent),
|
||||
)
|
||||
);
|
||||
|
||||
SettingTile get _debugMode => SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.developer_board_24_regular
|
||||
),
|
||||
title: Text("Debug mode"),
|
||||
subtitle: Text("Whether the launcher should disable automatic features for troubleshooting"),
|
||||
contentWidth: null,
|
||||
content: Row(
|
||||
children: [
|
||||
Text(
|
||||
_settingsController.debug.value ? translations.on : translations.off
|
||||
),
|
||||
const SizedBox(
|
||||
width: 16.0
|
||||
),
|
||||
Obx(() => ToggleSwitch(
|
||||
checked: _settingsController.debug.value,
|
||||
onChanged: (value) => _settingsController.debug.value = value
|
||||
))
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
extension _ThemeModeExtension on ThemeMode {
|
||||
|
||||
@@ -36,7 +36,6 @@ Future<bool> pingGameServer(String address, {Duration? timeout}) async {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
final start = DateTime.now();
|
||||
var firstTime = true;
|
||||
final split = address.split(":");
|
||||
|
||||
@@ -2,17 +2,24 @@ import 'dart:io';
|
||||
|
||||
import 'package:fluent_ui/fluent_ui.dart' hide FluentIcons;
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:reboot_launcher/src/util/translations.dart';
|
||||
import 'package:reboot_launcher/src/widget/file_selector.dart';
|
||||
import 'package:reboot_launcher/src/widget/setting_tile.dart';
|
||||
|
||||
SettingTile createFileSetting({required String title, required String description, required TextEditingController controller}) => SettingTile(
|
||||
SettingTile createFileSetting({required String title, required String description, required TextEditingController controller, required void Function() onReset}) {
|
||||
final obx = RxString(controller.text);
|
||||
controller.addListener(() => obx.value = controller.text);
|
||||
return SettingTile(
|
||||
icon: Icon(
|
||||
FluentIcons.document_24_regular
|
||||
),
|
||||
title: Text(title),
|
||||
subtitle: Text(description),
|
||||
content: FileSelector(
|
||||
content: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: FileSelector(
|
||||
placeholder: translations.selectPathPlaceholder,
|
||||
windowTitle: translations.selectPathWindowTitle,
|
||||
controller: controller,
|
||||
@@ -20,8 +27,30 @@ SettingTile createFileSetting({required String title, required String descriptio
|
||||
extension: "dll",
|
||||
folder: false,
|
||||
validatorMode: AutovalidateMode.always
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8.0),
|
||||
Obx(() => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: _checkDll(obx.value) == null ? 0.0 : 20.0
|
||||
),
|
||||
child: Button(
|
||||
style: ButtonStyle(
|
||||
padding: ButtonState.all(EdgeInsets.zero)
|
||||
),
|
||||
onPressed: onReset,
|
||||
child: SizedBox.square(
|
||||
dimension: 30,
|
||||
child: Icon(
|
||||
FluentIcons.arrow_reset_24_regular
|
||||
),
|
||||
)
|
||||
),
|
||||
))
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
String? _checkDll(String? text) {
|
||||
if (text == null || text.isEmpty) {
|
||||
|
||||
@@ -9,13 +9,13 @@ import 'package:local_notifier/local_notifier.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:reboot_common/common.dart';
|
||||
import 'package:reboot_launcher/src/controller/backend_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/dll_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/game_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/hosting_controller.dart';
|
||||
import 'package:reboot_launcher/src/controller/settings_controller.dart';
|
||||
import 'package:reboot_launcher/src/messenger/abstract/dialog.dart';
|
||||
import 'package:reboot_launcher/src/messenger/abstract/info_bar.dart';
|
||||
import 'package:reboot_launcher/src/messenger/implementation/server.dart';
|
||||
import 'package:reboot_launcher/src/page/abstract/page_type.dart';
|
||||
import 'package:reboot_launcher/src/page/pages.dart';
|
||||
import 'package:reboot_launcher/src/util/matchmaker.dart';
|
||||
import 'package:reboot_launcher/src/util/os.dart';
|
||||
@@ -40,11 +40,13 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
final GameController _gameController = Get.find<GameController>();
|
||||
final HostingController _hostingController = Get.find<HostingController>();
|
||||
final BackendController _backendController = Get.find<BackendController>();
|
||||
final DllController _dllController = Get.find<DllController>();
|
||||
final SettingsController _settingsController = Get.find<SettingsController>();
|
||||
|
||||
InfoBarEntry? _gameClientInfoBar;
|
||||
InfoBarEntry? _gameServerInfoBar;
|
||||
CancelableOperation? _operation;
|
||||
CancelableOperation? _pingOperation;
|
||||
IVirtualDesktop? _virtualDesktop;
|
||||
|
||||
@override
|
||||
@@ -94,10 +96,6 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
log("[${host ? 'HOST' : 'GAME'}] Checking dlls: ${InjectableDll.values}");
|
||||
for (final injectable in InjectableDll.values) {
|
||||
if(await _getDllFileOrStop(injectable, host) == null) {
|
||||
_onStop(
|
||||
reason: _StopReason.missingCustomDllError,
|
||||
error: injectable.name,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +121,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
return;
|
||||
}
|
||||
log("[${host ? 'HOST' : 'GAME'}] Backend works");
|
||||
final serverType = _hostingController.type.value;
|
||||
final serverType = _settingsController.debug.value ? GameServerType.window : _hostingController.type.value;
|
||||
log("[${host ? 'HOST' : 'GAME'}] Implicit game server metadata: headless($serverType)");
|
||||
final linkedHostingInstance = await _startMatchMakingServer(version, host, serverType, false);
|
||||
log("[${host ? 'HOST' : 'GAME'}] Implicit game server result: $linkedHostingInstance");
|
||||
@@ -139,6 +137,12 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
}else {
|
||||
_showLaunchingGameServerWidget();
|
||||
}
|
||||
} on ProcessException catch (exception, stackTrace) {
|
||||
_onStop(
|
||||
reason: _StopReason.corruptedVersionError,
|
||||
error: exception.toString(),
|
||||
stackTrace: stackTrace
|
||||
);
|
||||
} catch (exception, stackTrace) {
|
||||
_onStop(
|
||||
reason: _StopReason.unknownError,
|
||||
@@ -155,6 +159,11 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(_settingsController.debug.value) {
|
||||
log("[${host ? 'HOST' : 'GAME'}] The user is on debug mode, not asking for auto server");
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!forceLinkedHosting && _backendController.type.value == ServerType.embedded && !isLocalHost(_backendController.gameServerAddress.text)) {
|
||||
log("[${host ? 'HOST' : 'GAME'}] Backend is not set to embedded and/or not pointing to the local game server");
|
||||
return null;
|
||||
@@ -252,7 +261,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
host,
|
||||
hostType,
|
||||
false,
|
||||
""
|
||||
host ? _hostingController.customLaunchArgs.text : _gameController.customLaunchArgs.text
|
||||
);
|
||||
log("[${host ? 'HOST' : 'GAME'}] Generated game args: ${gameArgs.join(" ")}");
|
||||
final gameProcess = await startProcess(
|
||||
@@ -264,15 +273,29 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
"OPENSSL_ia32cap": "~0x20000000"
|
||||
}
|
||||
);
|
||||
final instance = host ? _hostingController.instance.value : _gameController.instance.value;
|
||||
void onGameOutput(String line, bool error) {
|
||||
log("[${host ? 'HOST' : 'GAME'}] ${error ? '[ERROR]' : '[MESSAGE]'} $line");
|
||||
|
||||
handleGameOutput(
|
||||
line: line,
|
||||
host: host,
|
||||
onShutdown: () => _onStop(reason: _StopReason.normal),
|
||||
onTokenError: () => _onStop(reason: _StopReason.tokenError),
|
||||
onBuildCorrupted: () => _onStop(reason: _StopReason.corruptedVersionError),
|
||||
onTokenError: () {
|
||||
if(_settingsController.debug.value) {
|
||||
log("[PROCESS] Ignoring token error because debug mode is on");
|
||||
}else {
|
||||
_onStop(reason: _StopReason.tokenError);
|
||||
}
|
||||
},
|
||||
onBuildCorrupted: () {
|
||||
if(instance == null) {
|
||||
return;
|
||||
}else if(!instance.launched) {
|
||||
_onStop(reason: _StopReason.corruptedVersionError);
|
||||
}else {
|
||||
_onStop(reason: _StopReason.crash);
|
||||
}
|
||||
},
|
||||
onLoggedIn: () =>_onLoggedIn(host),
|
||||
onMatchEnd: () => _onMatchEnd(version),
|
||||
onDisplayAttached: () => _onDisplayAttached(host, hostType, version)
|
||||
@@ -392,7 +415,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
await _injectOrShowError(InjectableDll.console, host);
|
||||
_onGameClientInjected();
|
||||
}else {
|
||||
final gameServerPort = int.tryParse(_settingsController.gameServerPort.text);
|
||||
final gameServerPort = int.tryParse(_dllController.gameServerPort.text);
|
||||
if(gameServerPort != null) {
|
||||
await killProcessByPort(gameServerPort);
|
||||
}
|
||||
@@ -425,11 +448,12 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
loading: true,
|
||||
duration: null
|
||||
);
|
||||
final gameServerPort = _settingsController.gameServerPort.text;
|
||||
final localPingResult = await pingGameServer(
|
||||
final gameServerPort = _dllController.gameServerPort.text;
|
||||
this._pingOperation = await CancelableOperation.fromFuture(pingGameServer(
|
||||
"127.0.0.1:$gameServerPort",
|
||||
timeout: const Duration(minutes: 2)
|
||||
);
|
||||
));
|
||||
final localPingResult = (await _pingOperation?.value) ?? false;
|
||||
_gameServerInfoBar?.close();
|
||||
if (!localPingResult) {
|
||||
showRebootInfoBar(
|
||||
@@ -472,16 +496,18 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
duration: null
|
||||
);
|
||||
final publicIp = await Ipify.ipv4();
|
||||
final externalResult = await pingGameServer("$publicIp:$gameServerPort");
|
||||
this._pingOperation = CancelableOperation.fromFuture(pingGameServer("$publicIp:$gameServerPort"));
|
||||
final externalResult = (await _pingOperation?.value) ?? false;
|
||||
if (externalResult) {
|
||||
return true;
|
||||
}
|
||||
|
||||
_gameServerInfoBar?.close();
|
||||
final future = pingGameServer(
|
||||
this._pingOperation = CancelableOperation.fromFuture(pingGameServer(
|
||||
"$publicIp:$gameServerPort",
|
||||
timeout: const Duration(days: 365)
|
||||
);
|
||||
));
|
||||
final future = await _pingOperation?.value ?? false;
|
||||
_gameServerInfoBar = showRebootInfoBar(
|
||||
translations.checkGameServerFixMessage(gameServerPort),
|
||||
action: Button(
|
||||
@@ -500,12 +526,19 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
|
||||
Future<void> _onStop({required _StopReason reason, bool? host, String? error, StackTrace? stackTrace}) async {
|
||||
if(host == null) {
|
||||
await _pingOperation?.cancel();
|
||||
_pingOperation = null;
|
||||
await _operation?.cancel();
|
||||
_operation = null;
|
||||
_backendController.cancelInteractive();
|
||||
}
|
||||
|
||||
host = host ?? widget.host;
|
||||
final instance = host ? _hostingController.instance.value : _gameController.instance.value;
|
||||
if(instance == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(host){
|
||||
_hostingController.instance.value = null;
|
||||
}else {
|
||||
@@ -527,7 +560,6 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
_hostingController.discardServer();
|
||||
}
|
||||
|
||||
if(instance != null) {
|
||||
if(reason == _StopReason.normal) {
|
||||
instance.launched = true;
|
||||
}
|
||||
@@ -540,7 +572,6 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
host: child.serverType != null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_setStarted(host, false);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
@@ -571,7 +602,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
);
|
||||
break;
|
||||
case _StopReason.exitCode:
|
||||
if(instance != null && !instance.launched) {
|
||||
if(!instance.launched) {
|
||||
showRebootInfoBar(
|
||||
translations.corruptedVersionError,
|
||||
severity: InfoBarSeverity.error,
|
||||
@@ -584,6 +615,10 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
translations.corruptedVersionError,
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration,
|
||||
action: Button(
|
||||
onPressed: () => launchUrl(launcherLogFile.uri),
|
||||
child: Text(translations.openLog),
|
||||
)
|
||||
);
|
||||
break;
|
||||
case _StopReason.corruptedDllError:
|
||||
@@ -601,8 +636,9 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
);
|
||||
break;
|
||||
case _StopReason.tokenError:
|
||||
_backendController.stop();
|
||||
showRebootInfoBar(
|
||||
translations.tokenError(instance?.injectedDlls.map((element) => element.name).join(", ") ?? translations.none),
|
||||
translations.tokenError(instance.injectedDlls.map((element) => element.name).join(", ")),
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration,
|
||||
action: Button(
|
||||
@@ -611,6 +647,13 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
)
|
||||
);
|
||||
break;
|
||||
case _StopReason.crash:
|
||||
showRebootInfoBar(
|
||||
translations.fortniteCrashError(host ? "game server" : "client"),
|
||||
severity: InfoBarSeverity.error,
|
||||
duration: infoBarLongDuration,
|
||||
);
|
||||
break;
|
||||
case _StopReason.unknownError:
|
||||
showRebootInfoBar(
|
||||
translations.unknownFortniteError(error ?? translations.unknownError),
|
||||
@@ -644,6 +687,10 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
}
|
||||
|
||||
log("[${hosting ? 'HOST' : 'GAME'}] Trying to inject ${injectable.name}...");
|
||||
if(_settingsController.debug.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
await injectDll(gameProcess, dllPath);
|
||||
instance.injectedDlls.add(injectable);
|
||||
log("[${hosting ? 'HOST' : 'GAME'}] Injected ${injectable.name}");
|
||||
@@ -660,7 +707,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
|
||||
Future<File?> _getDllFileOrStop(InjectableDll injectable, bool host, [bool isRetry = false]) async {
|
||||
log("[${host ? 'HOST' : 'GAME'}] Checking dll ${injectable}...");
|
||||
final (file, customDll) = _settingsController.getInjectableData(injectable);
|
||||
final (file, customDll) = _dllController.getInjectableData(injectable);
|
||||
log("[${host ? 'HOST' : 'GAME'}] Path: ${file.path}, custom: $customDll");
|
||||
if(await file.exists()) {
|
||||
log("[${host ? 'HOST' : 'GAME'}] Path exists");
|
||||
@@ -668,13 +715,17 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
}
|
||||
|
||||
log("[${host ? 'HOST' : 'GAME'}] Path doesn't exist");
|
||||
if(customDll || isRetry) {
|
||||
if(customDll) {
|
||||
log("[${host ? 'HOST' : 'GAME'}] Custom dll -> no recovery");
|
||||
_onStop(
|
||||
reason: _StopReason.missingCustomDllError,
|
||||
error: injectable.name,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
log("[${host ? 'HOST' : 'GAME'}] Path does not exist, downloading critical dll again...");
|
||||
await _settingsController.downloadCriticalDllInteractive(file.path);
|
||||
await _dllController.downloadCriticalDllInteractive(file.path, force: true);
|
||||
log("[${host ? 'HOST' : 'GAME'}] Downloaded dll again, retrying check...");
|
||||
return _getDllFileOrStop(injectable, host, true);
|
||||
}
|
||||
@@ -691,7 +742,7 @@ class _LaunchButtonState extends State<LaunchButton> {
|
||||
loading: true,
|
||||
duration: null,
|
||||
action: Obx(() {
|
||||
if(_hostingController.started.value || linkedHosting) {
|
||||
if(_settingsController.debug.value || _hostingController.started.value || linkedHosting) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
@@ -727,7 +778,8 @@ enum _StopReason {
|
||||
matchmakerError,
|
||||
tokenError,
|
||||
unknownError,
|
||||
exitCode;
|
||||
exitCode,
|
||||
crash;
|
||||
|
||||
bool get isError => name.contains("Error");
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
name: reboot_launcher
|
||||
description: Graphical User Interface for Project Reboot
|
||||
version: "9.2.0"
|
||||
version: "9.2.6"
|
||||
|
||||
publish_to: 'none'
|
||||
|
||||
@@ -74,6 +74,9 @@ dependencies:
|
||||
package_info_plus: ^8.0.0
|
||||
version: ^3.0.2
|
||||
|
||||
# Validate profile
|
||||
email_validator: ^3.0.0
|
||||
|
||||
dependency_overrides:
|
||||
xml: ^6.3.0
|
||||
http: ^0.13.5
|
||||
@@ -98,4 +101,9 @@ flutter:
|
||||
- assets/backend/profiles/
|
||||
- assets/backend/public/
|
||||
- assets/backend/responses/
|
||||
- assets/backend/responses/Athena/
|
||||
- assets/backend/responses/Athena/BattlePass/
|
||||
- assets/backend/responses/Athena/Discovery/
|
||||
- assets/backend/responses/Campaign/
|
||||
- assets/backend/responses/CloudDir/
|
||||
- assets/build/
|
||||
@@ -1,7 +1,3 @@
|
||||
#define public Dependency_Path_NetCoreCheck "..\..\dependencies\InnoDependencyInstaller\"
|
||||
|
||||
#include "..\..\dependencies\InnoDependencyInstaller\CodeDependencies.iss"
|
||||
|
||||
[Setup]
|
||||
AppId={{APP_ID}}
|
||||
AppVersion={{APP_VERSION}}
|
||||
@@ -20,10 +16,14 @@ PrivilegesRequired=admin
|
||||
ArchitecturesAllowed=x64
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
ChangesEnvironment=yes
|
||||
SetupLogging=yes
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[CustomMessages]
|
||||
InstallingVC2017redist=Installing Visual C++ Redistributable
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
|
||||
Name: "launchAtStartup"; Description: "{cm:AutoStartProgram,{{DISPLAY_NAME}}}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
@@ -33,10 +33,12 @@ Name: "{app}"; Permissions: everyone-full
|
||||
|
||||
[Files]
|
||||
Source: "{{SOURCE_DIR}}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full
|
||||
Source: "..\..\dependencies\redist\VC_redist.x64.exe"; DestDir: {tmp}; Flags: dontcopy
|
||||
|
||||
[Run]
|
||||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""Add-MpPreference -ExclusionPath '{app}'"""; Flags: runhidden
|
||||
Filename: "{app}\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: runascurrentuser nowait postinstall skipifsilent
|
||||
Filename: "{tmp}\VC_redist.x64.exe"; StatusMsg: "{cm:InstallingVC2017redist}"; Parameters: "/quiet"; Check: VC2017RedistNeedsInstall; Flags: waituntilterminated
|
||||
|
||||
[Icons]
|
||||
Name: "{autoprograms}\{{DISPLAY_NAME}}"; Filename: "{app}\{{EXECUTABLE_NAME}}"
|
||||
@@ -44,13 +46,43 @@ Name: "{autodesktop}\{{DISPLAY_NAME}}"; Filename: "{app}\{{EXECUTABLE_NAME}}"; T
|
||||
Name: "{userstartup}\{{DISPLAY_NAME}}"; Filename: "{app}\{{EXECUTABLE_NAME}}"; WorkingDir: "{app}"; Tasks: launchAtStartup
|
||||
|
||||
[Code]
|
||||
function InitializeSetup: Boolean;
|
||||
function CompareVersion(version1, version2: String): Integer;
|
||||
var
|
||||
packVersion1, packVersion2: Int64;
|
||||
begin
|
||||
Dependency_AddVC2015To2022
|
||||
Result := True;
|
||||
if not StrToVersion(version1, packVersion1) then packVersion1 := 0;
|
||||
if not StrToVersion(version2, packVersion2) then packVersion2 := 0;
|
||||
Result := ComparePackedVersion(packVersion1, packVersion2);
|
||||
end;
|
||||
|
||||
function BoolToStr(Value: Boolean): String;
|
||||
begin
|
||||
if Value then
|
||||
Result := 'Yes'
|
||||
else
|
||||
Result := 'No';
|
||||
end;
|
||||
|
||||
function VC2017RedistNeedsInstall: Boolean;
|
||||
var
|
||||
Version: String;
|
||||
begin
|
||||
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Version', Version) then
|
||||
begin
|
||||
Result := (CompareVersion(Copy(Version, 2, Length(Version)), '14.40.33810.00') < 0);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Result := True;
|
||||
end;
|
||||
Log('Visual C++ Redistributable version: ' + Version);
|
||||
Log('Needs installation? ' + BoolToStr(Result));
|
||||
if (Result) then
|
||||
begin
|
||||
ExtractTemporaryFile('VC_redist.x64.exe');
|
||||
end;
|
||||
end;
|
||||
|
||||
[Registry]
|
||||
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "OPENSSL_ia32cap"; \
|
||||
ValueData: "~0x20000000"; Flags: preservestringtype
|
||||
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "OPENSSL_ia32cap"; ValueData: "~0x20000000"; Flags: preservestringtype
|
||||
|
||||
|
||||
Reference in New Issue
Block a user