Fix new installation startup issue where version would be null on new installs
This commit is contained in:
parent
53fe7ee983
commit
a63154b581
@ -9,7 +9,7 @@ namespace Tranga;
|
|||||||
|
|
||||||
public static class Migrator
|
public static class Migrator
|
||||||
{
|
{
|
||||||
private static readonly ushort CurrentVersion = 17;
|
internal static readonly ushort CurrentVersion = 17;
|
||||||
public static void Migrate(string settingsFilePath, Logger? logger)
|
public static void Migrate(string settingsFilePath, Logger? logger)
|
||||||
{
|
{
|
||||||
if (!File.Exists(settingsFilePath))
|
if (!File.Exists(settingsFilePath))
|
||||||
|
@ -38,8 +38,12 @@ public static class Tranga
|
|||||||
{
|
{
|
||||||
logger.WriteLine("Tranga", $"Loading settings {settingsFilePath}");
|
logger.WriteLine("Tranga", $"Loading settings {settingsFilePath}");
|
||||||
settings = TrangaSettings.LoadSettings(settingsFilePath);
|
settings = TrangaSettings.LoadSettings(settingsFilePath);
|
||||||
}else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
settings = new TrangaSettings(downloadFolderPath, applicationFolderPath);
|
settings = new TrangaSettings(downloadFolderPath, applicationFolderPath);
|
||||||
|
settings.version = Migrator.CurrentVersion;
|
||||||
|
}
|
||||||
|
|
||||||
Directory.CreateDirectory(settings.workingDirectory);
|
Directory.CreateDirectory(settings.workingDirectory);
|
||||||
Directory.CreateDirectory(settings.downloadLocation);
|
Directory.CreateDirectory(settings.downloadLocation);
|
||||||
|
Loading…
Reference in New Issue
Block a user