private static async Task <GenericModsEnabler> GetEnabler() { return(await GenericModsEnabler.GetInstanceAsync( AcRootDirectory.Instance.RequireValue, SettingsHolder.GenericMods.GetModsDirectory(), SettingsHolder.GenericMods.UseHardLinks)); }
public void Load() { var mods = SettingsHolder.GenericMods.GetModsDirectory(); if (Directory.Exists(mods)) { _enabler = GenericModsEnabler.GetInstanceAsync(AcRootDirectory.Instance.RequireValue, mods, SettingsHolder.GenericMods.UseHardLinks).Result; } }
public async Task LoadAsync(CancellationToken cancellationToken) { var mods = SettingsHolder.GenericMods.GetModsDirectory(); if (Directory.Exists(mods)) { _enabler = await GenericModsEnabler.GetInstanceAsync(AcRootDirectory.Instance.RequireValue, mods, SettingsHolder.GenericMods.UseHardLinks); } }
protected override async Task EnableAfterInstallation(CancellationToken token) { var enabler = await GenericModsEnabler.GetInstanceAsync( AcRootDirectory.Instance.RequireValue, SettingsHolder.GenericMods.GetModsDirectory(), SettingsHolder.GenericMods.UseHardLinks); enabler.ReloadList(); var mod = enabler.GetByName(Name); if (mod?.IsEnabled == false) { await enabler.EnableAsync(mod).ConfigureAwait(false); } }