From ecc9ec3f9fcf2bb7d140939e91f6549b78e1b828 Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Sun, 20 Nov 2022 15:56:42 +0000 Subject: [PATCH] Finalize quiet launching (#47) Added two new args: -uninstall and -nolaunch --- Bloxstrap/Bootstrapper.cs | 15 +++++++++------ Bloxstrap/Program.cs | 4 ++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 7e8f66c..a18d652 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -98,6 +98,9 @@ namespace Bloxstrap // this is called from BootstrapperStyleForm.SetupDialog() public async Task Run() { + if (Program.IsQuiet) + Dialog.CloseDialog(); + if (Program.IsUninstall) { Uninstall(); @@ -122,14 +125,13 @@ namespace Bloxstrap CheckInstall(); await RbxFpsUnlocker.CheckInstall(); - - //if (Program.IsFirstRun) - // Dialog.ShowSuccess($"{Program.ProjectName} has been installed"); - //else - + Program.SettingsManager.Save(); - if (!Program.IsQuiet) + + if (Program.IsFirstRun && Program.IsNoLaunch) + Dialog.ShowSuccess($"{Program.ProjectName} has successfully installed"); + else if (!Program.IsNoLaunch) await StartRoblox(); Program.Exit(); @@ -301,6 +303,7 @@ namespace Bloxstrap uninstallKey.SetValue("NoRepair", 1); uninstallKey.SetValue("Publisher", Program.ProjectName); uninstallKey.SetValue("ModifyPath", $"\"{Directories.App}\" -preferences"); + uninstallKey.SetValue("QuietUninstallString", $"\"{Directories.App}\" -uninstall -quiet"); uninstallKey.SetValue("UninstallString", $"\"{Directories.App}\" -uninstall"); uninstallKey.SetValue("URLInfoAbout", $"https://github.com/{Program.ProjectRepository}"); uninstallKey.SetValue("URLUpdateInfo", $"https://github.com/{Program.ProjectRepository}/releases/latest"); diff --git a/Bloxstrap/Program.cs b/Bloxstrap/Program.cs index 2697786..0ed51b6 100644 --- a/Bloxstrap/Program.cs +++ b/Bloxstrap/Program.cs @@ -35,6 +35,7 @@ namespace Bloxstrap public static bool IsFirstRun { get; private set; } = false; public static bool IsQuiet { get; private set; } = false; public static bool IsUninstall { get; private set; } = false; + public static bool IsNoLaunch { get; private set; } = false; public static string LocalAppData { get; private set; } = null!; public static string StartMenu { get; private set; } = null!; @@ -83,6 +84,9 @@ namespace Bloxstrap if (Array.IndexOf(args, "-uninstall") != -1) IsUninstall = true; + + if (Array.IndexOf(args, "-nolaunch") != -1) + IsNoLaunch = true; } // check if installed