Skip to content

Commit

Permalink
Fixes for 3.4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
halgari committed Nov 19, 2023
1 parent 292bfb8 commit b19d1aa
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
32 changes: 32 additions & 0 deletions Wabbajack.Launcher/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using System;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.ReactiveUI;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Wabbajack.Common;
using Wabbajack.Configuration;
using Wabbajack.Downloaders.Http;
using Wabbajack.DTOs;
using Wabbajack.DTOs.JsonConverters;
Expand All @@ -16,7 +19,9 @@
using Wabbajack.Networking.Http.Interfaces;
using Wabbajack.Networking.NexusApi;
using Wabbajack.Paths;
using Wabbajack.Paths.IO;
using Wabbajack.RateLimiter;
using Wabbajack.Services.OSIntegrated;
using Wabbajack.Services.OSIntegrated.TokenProviders;

namespace Wabbajack.Launcher;
Expand All @@ -36,6 +41,20 @@ public static void Main(string[] args)
services.AddNexusApi();
services.AddDTOConverters();
services.AddDTOSerializer();
services.AddSingleton(s => new Services.OSIntegrated.Configuration
{
EncryptedDataLocation = KnownFolders.WabbajackAppLocal.Combine("encrypted"),
ModListsDownloadLocation = KnownFolders.EntryPoint.Combine("downloaded_mod_lists"),
SavedSettingsLocation = KnownFolders.WabbajackAppLocal.Combine("saved_settings"),
LogLocation = KnownFolders.LauncherAwarePath.Combine("logs"),
ImageCacheLocation = KnownFolders.WabbajackAppLocal.Combine("image_cache")
});
services.AddSingleton<SettingsManager>();
services.AddSingleton<ResourceSettingsManager>();
services.AddSingleton<MainSettings>(s => GetAppSettings(s, MainSettings.SettingsFileName));
services.AddSingleton<MainWindowViewModel>();
services.AddSingleton<HttpClient>();
services.AddSingleton<ITokenProvider<NexusApiState>, NexusApiTokenProvider>();
Expand All @@ -62,6 +81,19 @@ public static void Main(string[] args)
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}

private static MainSettings GetAppSettings(IServiceProvider provider, string name)
{
var settingsManager = provider.GetRequiredService<SettingsManager>();
var settings = Task.Run(() => settingsManager.Load<MainSettings>(name)).Result;
if (settings.Upgrade())
{
settingsManager.Save(MainSettings.SettingsFileName, settings).FireAndForget();
}

return settings;
}

public static IServiceProvider Services { get; set; }

// Avalonia configuration, don't remove; also used by visual designer.
Expand Down
7 changes: 3 additions & 4 deletions buildall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ SET /p VERSION=<VERSION.txt
mkdir c:\tmp\publish-wj

dotnet clean
dotnet restore
dotnet publish Wabbajack.App.Wpf\Wabbajack.App.Wpf.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app /p:PublishReadyToRun=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded
dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\launcher /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded
dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app --self-contained /p:DebugType=embedded
dotnet publish Wabbajack.App.Wpf\Wabbajack.App.Wpf.csproj --framework "net8.0-windows" --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app /p:PublishReadyToRun=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded
dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj --framework "net8.0-windows" --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\launcher /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained /p:DebugType=embedded
dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --framework "net8.0-windows" --runtime win-x64 --configuration Release /p:Platform=x64 -o c:\tmp\publish-wj\app --self-contained /p:DebugType=embedded
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\app\Wabbajack.exe
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\launcher\Wabbajack.exe
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /fd sha256 /tr http://ts.ssl.com /td sha256 /sha1 8c26a8e0bf3e70eb89721cc4d86a87137153ccba c:\tmp\publish-wj\app\wabbajack-cli.exe
Expand Down

0 comments on commit b19d1aa

Please sign in to comment.