diff --git a/Stella.Launcher b/Stella.Launcher index bca8f476..55a0fb17 160000 --- a/Stella.Launcher +++ b/Stella.Launcher @@ -1 +1 @@ -Subproject commit bca8f47622bbd46b073e7592cbab3ef8479361b4 +Subproject commit 55a0fb17fdbf6b6fa8ec6f8a0e953dd66e6117a4 diff --git a/Stella.Prepare/Program.cs b/Stella.Prepare/Program.cs index 9935792a..695c04b1 100644 --- a/Stella.Prepare/Program.cs +++ b/Stella.Prepare/Program.cs @@ -61,7 +61,7 @@ public static async Task Run() if (string.IsNullOrEmpty(SavedGamePath) || !File.Exists(SavedGamePath)) { string errorMessage = SavedGamePath != null ? $"File was not found: {SavedGamePath}" : "Full game path was not found"; - Log.ErrorAndExit(new Exception($"{errorMessage}\n\nYou must provide the specific location where the game is installed.\nThis program will not modify ANY game files."), false, false); + Log.ErrorAndExit(new Exception($"{errorMessage}\n\nYou must provide the specific location where the game is installed.\nThis program will not modify ANY game files.")); } // If the variable is not empty, save the data @@ -102,7 +102,7 @@ public static async Task Run() } else { - Log.ErrorAndExit(new Exception("Unknown\n\nSorry. Directory with the resources was not found.\nIn the resources directory, files such as your shaders, presets, screenshots, and custom mods are stored."), false, false); + Log.ErrorAndExit(new Exception("Unknown\n\nSorry. Directory with the resources was not found.\nIn the resources directory, files such as your shaders, presets, screenshots, and custom mods are stored.")); } TaskbarProgress.SetProgressValue(26); diff --git a/Stella.Prepare/Scripts/Cmd.cs b/Stella.Prepare/Scripts/Cmd.cs index 961a112f..1d923fd5 100644 --- a/Stella.Prepare/Scripts/Cmd.cs +++ b/Stella.Prepare/Scripts/Cmd.cs @@ -107,7 +107,7 @@ public static async Task CliWrap(string app, string? args, string? workingDir) Console.WriteLine(@"Installing Microsoft Visual C++ 2015 UWP Desktop Package..."); if (!File.Exists(Start.VcLibsAppx)) - Log.ErrorAndExit(new Exception($"I can't find a required file. Please unpack downloaded zip archive.\nNot found: {Start.VcLibsAppx}"), false, false); + Log.ErrorAndExit(new Exception($"I can't find a required file. Please unpack downloaded zip archive.\nNot found: {Start.VcLibsAppx}")); Start.Logger.Info("Installing missing dependency VCLibs..."); await CliWrap("powershell", $"Add-AppxPackage -Path {Start.VcLibsAppx}", null).ConfigureAwait(false); @@ -158,8 +158,7 @@ public static async Task CliWrap(string app, string? args, string? workingDir) case 5: Log.ErrorAndExit( new Exception( - $"Software was denied access to a location for the purposes of saving, copying, opening, or loading files.\nRestart your computer or suspend antivirus program and try again.{info}"), - false, false); + $"Software was denied access to a location for the purposes of saving, copying, opening, or loading files.\nRestart your computer or suspend antivirus program and try again.{info}")); return; default: diff --git a/Stella.Prepare/Scripts/Log.cs b/Stella.Prepare/Scripts/Log.cs index f5945807..9ebff775 100644 --- a/Stella.Prepare/Scripts/Log.cs +++ b/Stella.Prepare/Scripts/Log.cs @@ -39,7 +39,7 @@ public static void ThrowError(Exception msg, bool tryAgain) TryAgain(tryAgain); } - public static void ErrorAndExit(Exception log, bool hideError, bool reportIssue) + public static void ErrorAndExit(Exception log, bool hideError = false, bool reportIssue = false) { Start.Logger.Error(log); diff --git a/Stella.Prepare/Scripts/Preparing/DownloadUpdateResources.cs b/Stella.Prepare/Scripts/Preparing/DownloadUpdateResources.cs index 5f5efb0b..a3eeecbe 100644 --- a/Stella.Prepare/Scripts/Preparing/DownloadUpdateResources.cs +++ b/Stella.Prepare/Scripts/Preparing/DownloadUpdateResources.cs @@ -62,7 +62,7 @@ public static async Task RunAsync() if (percentage == lastPercentage) continue; Console.SetCursorPosition(0, Console.CursorTop); - Console.Write($"\rDownloading Stella Mod resources... {totalBytes}.{receivedBytes} bytes ({percentage}%) at {speed / 1024:0.00} KB/s "); + Console.Write($"\rDownloading Stella Mod resources... {receivedBytes}/{totalBytes} bytes ({percentage}%) at {speed / 1024:0.00} KB/s "); lastPercentage = percentage; } diff --git a/Stella.Prepare/Scripts/Preparing/TerminalInstallation.cs b/Stella.Prepare/Scripts/Preparing/TerminalInstallation.cs index d537d10d..a025a10b 100644 --- a/Stella.Prepare/Scripts/Preparing/TerminalInstallation.cs +++ b/Stella.Prepare/Scripts/Preparing/TerminalInstallation.cs @@ -58,7 +58,7 @@ public static async Task MakeBackup() public static async Task Install() { if (!File.Exists(Start.WtMsixBundle)) - Log.ErrorAndExit(new Exception($"I can't find a required file: {Start.WtMsixBundle}"), false, false); + Log.ErrorAndExit(new Exception($"I can't find a required file: {Start.WtMsixBundle}")); Process[] dllHostName = Process.GetProcessesByName("dllhost"); if (dllHostName.Length != 0) await Cmd.CliWrap("taskkill", "/F /IM dllhost.exe", null).ConfigureAwait(false); @@ -80,7 +80,7 @@ public static async Task Install() string? wtProgramFiles = Utils.GetWtProgramFiles(); if (string.IsNullOrEmpty(wtProgramFiles)) { - Log.ErrorAndExit(new Exception($"Windows Terminal directory was not found in: {Program.WindowsApps}"), false, false); + Log.ErrorAndExit(new Exception($"Windows Terminal directory was not found in: {Program.WindowsApps}")); } else { diff --git a/Stella.Prepare/Scripts/Preparing/UpdateReShadeCfg.cs b/Stella.Prepare/Scripts/Preparing/UpdateReShadeCfg.cs index ff88c153..e3e4562c 100644 --- a/Stella.Prepare/Scripts/Preparing/UpdateReShadeCfg.cs +++ b/Stella.Prepare/Scripts/Preparing/UpdateReShadeCfg.cs @@ -19,7 +19,7 @@ public static async Task RunAsync() await DownloadFileAsync("https://cdn.sefinek.net/resources/v3/genshin-stella-mod/reshade/ReShade.ini", reshadeIniPath).ConfigureAwait(false); await DownloadFileAsync("https://cdn.sefinek.net/resources/v3/genshin-stella-mod/reshade/ReShade.log", reshadeLogPath).ConfigureAwait(false); - if (!File.Exists(reshadeIniPath) || !File.Exists(reshadeLogPath)) Log.ErrorAndExit(new Exception($"Something went wrong. Config or log file for ReShade was not found in: {giGame}"), false, false); + if (!File.Exists(reshadeIniPath) || !File.Exists(reshadeLogPath)) Log.ErrorAndExit(new Exception($"Something went wrong. Config or log file for ReShade was not found in: {giGame}")); Start.Logger.Info($"{Path.GetFileName(reshadeIniPath)} and {Path.GetFileName(reshadeLogPath)} were successfully downloaded."); diff --git a/Stella.Prepare/Start.cs b/Stella.Prepare/Start.cs index 7c9c6acc..600b11b0 100644 --- a/Stella.Prepare/Start.cs +++ b/Stella.Prepare/Start.cs @@ -64,7 +64,7 @@ private static async Task Main() if (!Utils.IsRunAsAdmin()) { TaskbarProgress.SetProgressValue(100); - Log.ErrorAndExit(new Exception("» This application requires administrator privileges to run."), false, false); + Log.ErrorAndExit(new Exception("» This application requires administrator privileges to run.")); return; } @@ -93,7 +93,7 @@ private static async Task Main() } catch (Exception ex) { - Log.ErrorAndExit(ex, false, false); + Log.ErrorAndExit(ex); } }