mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add -upgrade installer arg (#47)
This commit is contained in:
parent
2b21720894
commit
b950488ed7
@ -23,11 +23,21 @@ namespace Bloxstrap.Helpers
|
||||
|
||||
if (installedVersionInfo.ProductVersion != currentVersionInfo.ProductVersion)
|
||||
{
|
||||
DialogResult result = Program.ShowMessageBox(
|
||||
$"The version of {Program.ProjectName} you've launched is different to the version you currently have installed.\nWould you like to update your currently installed version?",
|
||||
MessageBoxIcon.Question,
|
||||
MessageBoxButtons.YesNo
|
||||
);
|
||||
DialogResult result;
|
||||
|
||||
if (Program.IsUpgrade)
|
||||
{
|
||||
result = DialogResult.Yes;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = Program.ShowMessageBox(
|
||||
$"The version of {Program.ProjectName} you've launched is different to the version you currently have installed.\nWould you like to upgrade your currently installed version?",
|
||||
MessageBoxIcon.Question,
|
||||
MessageBoxButtons.YesNo
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
@ -42,9 +52,11 @@ namespace Bloxstrap.Helpers
|
||||
MessageBoxButtons.OK
|
||||
);
|
||||
|
||||
new Preferences().ShowDialog();
|
||||
|
||||
Program.Exit();
|
||||
if (!Program.IsQuiet)
|
||||
{
|
||||
new Preferences().ShowDialog();
|
||||
Program.Exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ namespace Bloxstrap
|
||||
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 bool IsUpgrade { get; private set; } = false;
|
||||
|
||||
public static string LocalAppData { get; private set; } = null!;
|
||||
public static string StartMenu { get; private set; } = null!;
|
||||
@ -87,6 +88,9 @@ namespace Bloxstrap
|
||||
|
||||
if (Array.IndexOf(args, "-nolaunch") != -1)
|
||||
IsNoLaunch = true;
|
||||
|
||||
if (Array.IndexOf(args, "-upgrade") != -1)
|
||||
IsUpgrade = true;
|
||||
}
|
||||
|
||||
// check if installed
|
||||
|
Loading…
Reference in New Issue
Block a user