add maintenance mode & improve & bugfixing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using ModpackUpdater.Manager;
|
||||
using ModpackUpdater.Model;
|
||||
using Mono.Options;
|
||||
using Newtonsoft.Json;
|
||||
using Pilz.Configuration;
|
||||
using Telerik.WinControls;
|
||||
@@ -24,12 +23,12 @@ public static class Program
|
||||
{
|
||||
var options = new Options(args);
|
||||
if (options.NoUi)
|
||||
InstallWithoutGui(options.ModpackConfig, options.ProfileFolder, options.Silent, options.Side, options.AllowUpdaterAfterInstall);
|
||||
InstallWithoutGui(options.UpdateOptions, options.Silent);
|
||||
else
|
||||
RunApp(options.ModpackConfig, options.ProfileFolder, options.Side, options.AllowUpdaterAfterInstall, !options.NoUpdate);
|
||||
RunApp(options.UpdateOptions);
|
||||
}
|
||||
|
||||
private static void RunApp(string modpackConfig, string profileFolder, Side side, bool allowUpdaterAfterInstall, bool allowUpdateCheck)
|
||||
private static void RunApp(UpdateCheckOptionsAdv updateOptions)
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
@@ -38,7 +37,7 @@ public static class Program
|
||||
if (ThemeResolutionService.LoadPackageResource("ModpackUpdater.CustomThemes.Office2019DarkBluePurple.tssp"))
|
||||
ThemeResolutionService.ApplicationThemeName = "Office2019DarkBluePurple";
|
||||
|
||||
Application.Run(new Form1(modpackConfig, profileFolder, side, allowUpdaterAfterInstall, allowUpdateCheck));
|
||||
Application.Run(new Form1(updateOptions));
|
||||
}
|
||||
|
||||
private static string GetSettingsPath(int? settingsVersion = 2)
|
||||
@@ -72,11 +71,14 @@ public static class Program
|
||||
File.Delete(settingsPath);
|
||||
}
|
||||
|
||||
private static void InstallWithoutGui(string modpackConfig, string profileFolder, bool silent, Side side, bool allowUpdaterAfterInstall)
|
||||
private static void InstallWithoutGui(UpdateCheckOptionsAdv updateOptions, bool silent)
|
||||
{
|
||||
var config = ModpackConfig.LoadFromUrl(modpackConfig);
|
||||
var installer = new ModpackInstaller(config, profileFolder);
|
||||
var result = installer.Check(side, allowUpdaterAfterInstall).Result;
|
||||
var config = ModpackConfig.LoadFromUrl(updateOptions.ModpackConfig);
|
||||
var installer = new ModpackInstaller(config, updateOptions.ProfileFolder);
|
||||
var result = installer.Check(updateOptions).Result;
|
||||
|
||||
if (!silent && !updateOptions.NoUpdate && new AppUpdater().Check().Result)
|
||||
Console.WriteLine("A new version is available!");
|
||||
|
||||
if (result.HasUpdates)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user