mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-07 14:55:16 -04:00
Windows: Creating an installer with a custom data directory path
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Autofac;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Kyoo.Host.Windows
|
||||
{
|
||||
@@ -13,6 +15,10 @@ namespace Kyoo.Host.Windows
|
||||
/// </summary>
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
object dataDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\SDG\Kyoo\Settings", "DataDir", null)
|
||||
?? Registry.GetValue(@"HKEY_CURRENT_USER\Software\SDG\Kyoo\Settings", "DataDir", null);
|
||||
if (dataDir is string data)
|
||||
Environment.SetEnvironmentVariable("KYOO_DATA_DIR", data);
|
||||
Kyoo.Program.SetupDataDir(args);
|
||||
|
||||
IHost host = Kyoo.Program.CreateWebHostBuilder(args)
|
||||
|
||||
Reference in New Issue
Block a user