diff --git a/CHANGELOG.md b/CHANGELOG.md index cf0cce3d..257f3dd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ * Errors when downloading modlists no longer cause the app to crash * Only parse and edit screen sizes in INI files when installing MO2 lists * Update the build to show source code names/numbers in exceptions in the logs +* Move logs back into the same folder as the launcher +* Update the launcher to once again load new versions from the Nexus when possible #### Version - 3.0.1.7 - 9/27/2022 * HOTFIX: fix "Could not find part of path" bug related to the profiles folder diff --git a/Wabbajack.App.Wpf/App.xaml.cs b/Wabbajack.App.Wpf/App.xaml.cs index 4c155bec..c4289cb7 100644 --- a/Wabbajack.App.Wpf/App.xaml.cs +++ b/Wabbajack.App.Wpf/App.xaml.cs @@ -14,6 +14,7 @@ using Wabbajack.DTOs.Interventions; using Wabbajack.Interventions; using Wabbajack.LoginManagers; using Wabbajack.Models; +using Wabbajack.Paths.IO; using Wabbajack.Services.OSIntegrated; using Wabbajack.UserIntervention; using Wabbajack.Util; @@ -49,10 +50,11 @@ namespace Wabbajack { var config = new NLog.Config.LoggingConfiguration(); + var logFolder = KnownFolders.LauncherAwarePath; var fileTarget = new FileTarget("file") { - FileName = "logs/Wabbajack.current.log", - ArchiveFileName = "logs/Wabbajack.{##}.log", + FileName = logFolder.Combine("Wabbajack.current.log").ToString(), + ArchiveFileName = logFolder.Combine("Wabbajack.{##}.log").ToString(), ArchiveOldFileOnStartup = true, MaxArchiveFiles = 10, Layout = "${processtime} [${level:uppercase=true}] (${logger}) ${message:withexception=true}", diff --git a/Wabbajack.Launcher/Program.cs b/Wabbajack.Launcher/Program.cs index d56c897c..f2dab596 100644 --- a/Wabbajack.Launcher/Program.cs +++ b/Wabbajack.Launcher/Program.cs @@ -17,6 +17,7 @@ using Wabbajack.Networking.Http.Interfaces; using Wabbajack.Networking.NexusApi; using Wabbajack.Paths; using Wabbajack.RateLimiter; +using Wabbajack.Services.OSIntegrated.TokenProviders; namespace Wabbajack.Launcher; @@ -37,7 +38,7 @@ internal class Program services.AddDTOSerializer(); services.AddSingleton(); services.AddSingleton(); - services.AddSingleton, LegacyNexusApiKey>(); + services.AddSingleton, NexusApiTokenProvider>(); services.AddSingleton(); services.AddAllSingleton>(s => new Resource("Web Requests", 4)); services.AddAllSingleton(); diff --git a/Wabbajack.Launcher/ViewModels/MainWindowViewModel.cs b/Wabbajack.Launcher/ViewModels/MainWindowViewModel.cs index 1f85f0b3..69522848 100644 --- a/Wabbajack.Launcher/ViewModels/MainWindowViewModel.cs +++ b/Wabbajack.Launcher/ViewModels/MainWindowViewModel.cs @@ -321,7 +321,7 @@ public class MainWindowViewModel : ViewModelBase Status = "Parsing Response"; //return JsonSerializer.Deserialize(data)!; - var found = data.info.Files.Where(f => f.CategoryId == 5) + var found = data.info.Files.Where(f => f.CategoryId == 5 || f.CategoryId == 3) .Where(f => f.Name.EndsWith(".zip")) .Select(f => Version.TryParse(f.Name[..^4], out var version) ? (version, f.SizeInBytes ?? f.Size, f.FileId) : default) .FirstOrDefault(f => f != default); diff --git a/Wabbajack.Launcher/Wabbajack.Launcher.csproj b/Wabbajack.Launcher/Wabbajack.Launcher.csproj index 3a51c5a2..fb961238 100644 --- a/Wabbajack.Launcher/Wabbajack.Launcher.csproj +++ b/Wabbajack.Launcher/Wabbajack.Launcher.csproj @@ -31,5 +31,6 @@ + diff --git a/Wabbajack.Paths.IO/KnownFolders.cs b/Wabbajack.Paths.IO/KnownFolders.cs index b242a7d0..c944e1e4 100644 --- a/Wabbajack.Paths.IO/KnownFolders.cs +++ b/Wabbajack.Paths.IO/KnownFolders.cs @@ -31,6 +31,18 @@ public static class KnownFolders } } + public static AbsolutePath LauncherAwarePath + { + get + { + var path = EntryPoint; + if (path.Depth <= 2) return path; + if (Version.TryParse(path.Parent.FileName.ToString(), out var version) && version > new Version("1.0.0.0")) + return path.Parent; + return path; + } + } + public static AbsolutePath AppDataLocal => Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData).ToAbsolutePath();