add maintenance mode & improve & bugfixing
This commit is contained in:
@@ -12,20 +12,17 @@ public partial class Form1
|
||||
private ModpackConfig updateConfig = new();
|
||||
private bool currentUpdating = false;
|
||||
private UpdateCheckResult lastUpdateCheckResult = null;
|
||||
private readonly bool allowUpdateCheck;
|
||||
private readonly bool allowUpdaterAfterInstall;
|
||||
private readonly Side side;
|
||||
private readonly UpdateCheckOptionsAdv updateOptions;
|
||||
|
||||
public Form1(string modpackConfig, string profilePath, Side side, bool allowUpdaterAfterInstall, bool allowUpdateCheck) : this()
|
||||
public Form1(UpdateCheckOptionsAdv updateOptions) : this()
|
||||
{
|
||||
this.allowUpdaterAfterInstall = allowUpdaterAfterInstall;
|
||||
this.side = side;
|
||||
this.updateOptions = updateOptions;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(modpackConfig))
|
||||
LoadUpdateConfigFile(modpackConfig);
|
||||
if (!string.IsNullOrWhiteSpace(updateOptions.ModpackConfig))
|
||||
LoadUpdateConfigFile(updateOptions.ModpackConfig);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(profilePath))
|
||||
LoadMinecraftProfile(profilePath);
|
||||
if (!string.IsNullOrWhiteSpace(updateOptions.ProfileFolder))
|
||||
LoadMinecraftProfile(updateOptions.ProfileFolder);
|
||||
}
|
||||
|
||||
public Form1()
|
||||
@@ -129,7 +126,7 @@ public partial class Form1
|
||||
|
||||
try
|
||||
{
|
||||
lastUpdateCheckResult = await updater.Check(side, allowUpdaterAfterInstall);
|
||||
lastUpdateCheckResult = await updater.Check(updateOptions);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -245,7 +242,7 @@ public partial class Form1
|
||||
private async void Form1_Shown(object sender, EventArgs e)
|
||||
{
|
||||
var updater = new AppUpdater();
|
||||
if (allowUpdateCheck && await updater.Check() && RadMessageBox.Show(LangRes.MsgBox_UpdateAvailable, LangRes.MsgBox_UpdateAvailable_Title, MessageBoxButtons.YesNo, RadMessageIcon.Info) == DialogResult.Yes)
|
||||
if (!updateOptions.NoUpdate && await updater.Check() && RadMessageBox.Show(LangRes.MsgBox_UpdateAvailable, LangRes.MsgBox_UpdateAvailable_Title, MessageBoxButtons.YesNo, RadMessageIcon.Info) == DialogResult.Yes)
|
||||
{
|
||||
SetStatus(LangRes.StatusText_InstallingAppUpdate, MySymbols.icons8_software_installer_16px);
|
||||
Enabled = false;
|
||||
|
||||
Reference in New Issue
Block a user