From 813537af7579c46dddead595c5b3b4905b79df3b Mon Sep 17 00:00:00 2001 From: rjindael Date: Wed, 2 Aug 2023 16:11:24 -0700 Subject: [PATCH] chore: move initialization error out of Bootstrapper::Initialize --- Kiseki.Launcher.Windows/Bootstrapper.cs | 2 -- Kiseki.Launcher.Windows/MainWindow.cs | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Kiseki.Launcher.Windows/Bootstrapper.cs b/Kiseki.Launcher.Windows/Bootstrapper.cs index d3ad921..4e6ae9e 100644 --- a/Kiseki.Launcher.Windows/Bootstrapper.cs +++ b/Kiseki.Launcher.Windows/Bootstrapper.cs @@ -28,7 +28,6 @@ public class Bootstrapper : Interfaces.IBootstrapper { if (!Helpers.Base64.IsBase64String(Payload)) { - Error($"Failed to launch {Constants.PROJECT_NAME}", $"Try launching {Constants.PROJECT_NAME} from the website again."); return false; } @@ -36,7 +35,6 @@ public class Bootstrapper : Interfaces.IBootstrapper string[] pieces = Helpers.Base64.ConvertBase64ToString(Payload).Split("|"); if (pieces.Length != 4) { - Error($"Failed to launch {Constants.PROJECT_NAME}", $"Try launching {Constants.PROJECT_NAME} from the website again."); return false; } diff --git a/Kiseki.Launcher.Windows/MainWindow.cs b/Kiseki.Launcher.Windows/MainWindow.cs index 1ab601d..440d6e8 100644 --- a/Kiseki.Launcher.Windows/MainWindow.cs +++ b/Kiseki.Launcher.Windows/MainWindow.cs @@ -33,8 +33,14 @@ public class MainWindow : Form Page.Created += (_, _) => { - if (Bootstrapper.Initialize()) - Bootstrapper.Run(); + if (!Bootstrapper.Initialize()) + { + // hack + Bootstrapper_Errored(null, new string[] { $"Failed to launch {Constants.PROJECT_NAME}", $"Try launching {Constants.PROJECT_NAME} from the website again." }); + return; + } + + Bootstrapper.Run(); }; // This is a small hack to ensure that the underlying Form that MainWindow has