install keys

This commit is contained in:
Schedel Pascal
2024-06-21 08:55:46 +02:00
parent f1185c242c
commit 20c1e5dc8e
12 changed files with 216 additions and 75 deletions

View File

@@ -62,7 +62,13 @@ public static class Program
// Migrate
var newConfig = Settings.Get<AppConfig>();
newConfig.LastMinecraftProfilePath = legacyConfig.LastMinecraftProfilePath;
newConfig.LastConfigFilePath = legacyConfig.LastConfigFilePath;
if (ModpackInfo.TryLoad(legacyConfig.LastMinecraftProfilePath) is ModpackInfo info)
{
#pragma warning disable CS0612 // Typ oder Element ist veraltet
info.ConfigUrl = legacyConfig.ConfigFilePath;
#pragma warning restore CS0612 // Typ oder Element ist veraltet
}
// Ensure save settings
settingsManager.Save();
@@ -75,6 +81,14 @@ public static class Program
{
var info = ModpackInfo.TryLoad(updateOptions.ProfileFolder);
var config = ModpackConfig.LoadFromUrl(CheckModpackConfigUrl(updateOptions.ModpackConfig, info));
// Check features
if (!string.IsNullOrWhiteSpace(updateOptions.ExtrasKey))
info.ExtrasKey = updateOptions.ExtrasKey;
if (!string.IsNullOrWhiteSpace(info.ExtrasKey))
updateOptions.IncludeExtras = AppFeatures.AllowExtras.IsEnabled(new AllowExtrasFeatureContext(info, config));
// Check for update
var installer = new ModpackInstaller(config, info);
var result = installer.Check(updateOptions).Result;