From 91c5bf4109ab6dee87f6a6647e9cec580cea5918 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Sat, 22 Jun 2019 15:40:22 -0500 Subject: [PATCH] Mark auto-install correctly when installing from .ckan file --- GUI/MainInstall.cs | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/GUI/MainInstall.cs b/GUI/MainInstall.cs index 6abe7ee935..a82d35e170 100644 --- a/GUI/MainInstall.cs +++ b/GUI/MainInstall.cs @@ -26,43 +26,32 @@ public partial class Main /// Module to install public async void InstallModuleDriver(IRegistryQuerier registry, CkanModule module) { - RelationshipResolverOptions install_ops = RelationshipResolver.DefaultOpts(); - install_ops.with_recommends = false; - try { - var initialChangeSet = new HashSet(); - // Install the selected mod - initialChangeSet.Add(new ModChange( - new GUIMod(module, registry, CurrentInstance.VersionCriteria()), - GUIModChangeType.Install, - null - )); + var userChangeSet = new List(); InstalledModule installed = registry.InstalledModule(module.identifier); if (installed != null) { // Already installed, remove it first - initialChangeSet.Add(new ModChange( + userChangeSet.Add(new ModChange( new GUIMod(installed.Module, registry, CurrentInstance.VersionCriteria()), GUIModChangeType.Remove, null )); } - List fullChangeSet = new List( - await mainModList.ComputeChangeSetFromModList( - registry, - initialChangeSet, - ModuleInstaller.GetInstance(CurrentInstance, Manager.Cache, GUI.user), - CurrentInstance.VersionCriteria() - ) - ); - if (fullChangeSet != null && fullChangeSet.Count > 0) + // Install the selected mod + userChangeSet.Add(new ModChange( + new GUIMod(module, registry, CurrentInstance.VersionCriteria()), + GUIModChangeType.Install, + null + )); + if (userChangeSet.Count > 0) { // Resolve the provides relationships in the dependencies installWorker.RunWorkerAsync( new KeyValuePair, RelationshipResolverOptions>( - fullChangeSet, - install_ops + userChangeSet, + RelationshipResolver.DependsOnlyOpts() ) ); }