This commit is contained in:
2024-06-20 06:30:24 +02:00
parent 00de4d8708
commit c31cc3aa20
6 changed files with 43 additions and 12 deletions

View File

@@ -24,12 +24,12 @@ public static class Program
{
var options = new Options(args);
if (options.NoUi)
InstallWithoutGui(options.ModpackConfig, options.ProfileFolder, options.Silent);
InstallWithoutGui(options.ModpackConfig, options.ProfileFolder, options.Silent, options.Side, options.AllowUpdaterAfterInstall);
else
RunApp(options.ModpackConfig, options.ProfileFolder);
RunApp(options.ModpackConfig, options.ProfileFolder, options.Side, options.AllowUpdaterAfterInstall, !options.NoUpdate);
}
private static void RunApp(string modpackConfig, string profileFolder)
private static void RunApp(string modpackConfig, string profileFolder, Side side, bool allowUpdaterAfterInstall, bool allowUpdateCheck)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
@@ -38,7 +38,7 @@ public static class Program
if (ThemeResolutionService.LoadPackageResource("ModpackUpdater.CustomThemes.Office2019DarkBluePurple.tssp"))
ThemeResolutionService.ApplicationThemeName = "Office2019DarkBluePurple";
Application.Run(new Form1(modpackConfig, profileFolder));
Application.Run(new Form1(modpackConfig, profileFolder, side, allowUpdaterAfterInstall, allowUpdateCheck));
}
private static string GetSettingsPath(int? settingsVersion = 2)
@@ -72,11 +72,11 @@ public static class Program
File.Delete(settingsPath);
}
private static void InstallWithoutGui(string modpackConfig, string profileFolder, bool silent)
private static void InstallWithoutGui(string modpackConfig, string profileFolder, bool silent, Side side, bool allowUpdaterAfterInstall)
{
var config = ModpackConfig.LoadFromUrl(modpackConfig);
var installer = new ModpackInstaller(config, profileFolder);
var result = installer.Check().Result;
var result = installer.Check(side, allowUpdaterAfterInstall).Result;
if (result.HasUpdates)
{