Finalize quiet launching (#47)

Added two new args: -uninstall and -nolaunch
This commit is contained in:
pizzaboxer 2022-11-20 15:56:42 +00:00
parent db762429cf
commit ecc9ec3f9f
2 changed files with 13 additions and 6 deletions

View File

@ -98,6 +98,9 @@ namespace Bloxstrap
// this is called from BootstrapperStyleForm.SetupDialog() // this is called from BootstrapperStyleForm.SetupDialog()
public async Task Run() public async Task Run()
{ {
if (Program.IsQuiet)
Dialog.CloseDialog();
if (Program.IsUninstall) if (Program.IsUninstall)
{ {
Uninstall(); Uninstall();
@ -123,13 +126,12 @@ namespace Bloxstrap
await RbxFpsUnlocker.CheckInstall(); await RbxFpsUnlocker.CheckInstall();
//if (Program.IsFirstRun)
// Dialog.ShowSuccess($"{Program.ProjectName} has been installed");
//else
Program.SettingsManager.Save(); Program.SettingsManager.Save();
if (!Program.IsQuiet)
if (Program.IsFirstRun && Program.IsNoLaunch)
Dialog.ShowSuccess($"{Program.ProjectName} has successfully installed");
else if (!Program.IsNoLaunch)
await StartRoblox(); await StartRoblox();
Program.Exit(); Program.Exit();
@ -301,6 +303,7 @@ namespace Bloxstrap
uninstallKey.SetValue("NoRepair", 1); uninstallKey.SetValue("NoRepair", 1);
uninstallKey.SetValue("Publisher", Program.ProjectName); uninstallKey.SetValue("Publisher", Program.ProjectName);
uninstallKey.SetValue("ModifyPath", $"\"{Directories.App}\" -preferences"); uninstallKey.SetValue("ModifyPath", $"\"{Directories.App}\" -preferences");
uninstallKey.SetValue("QuietUninstallString", $"\"{Directories.App}\" -uninstall -quiet");
uninstallKey.SetValue("UninstallString", $"\"{Directories.App}\" -uninstall"); uninstallKey.SetValue("UninstallString", $"\"{Directories.App}\" -uninstall");
uninstallKey.SetValue("URLInfoAbout", $"https://github.com/{Program.ProjectRepository}"); uninstallKey.SetValue("URLInfoAbout", $"https://github.com/{Program.ProjectRepository}");
uninstallKey.SetValue("URLUpdateInfo", $"https://github.com/{Program.ProjectRepository}/releases/latest"); uninstallKey.SetValue("URLUpdateInfo", $"https://github.com/{Program.ProjectRepository}/releases/latest");

View File

@ -35,6 +35,7 @@ namespace Bloxstrap
public static bool IsFirstRun { get; private set; } = false; public static bool IsFirstRun { get; private set; } = false;
public static bool IsQuiet { get; private set; } = false; public static bool IsQuiet { get; private set; } = false;
public static bool IsUninstall { 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 LocalAppData { get; private set; } = null!;
public static string StartMenu { get; private set; } = null!; public static string StartMenu { get; private set; } = null!;
@ -83,6 +84,9 @@ namespace Bloxstrap
if (Array.IndexOf(args, "-uninstall") != -1) if (Array.IndexOf(args, "-uninstall") != -1)
IsUninstall = true; IsUninstall = true;
if (Array.IndexOf(args, "-nolaunch") != -1)
IsNoLaunch = true;
} }
// check if installed // check if installed