From 959c8836af09130a549abe1f25a2ecab836b9af1 Mon Sep 17 00:00:00 2001 From: Asval Date: Sun, 8 Dec 2019 20:49:12 +0100 Subject: [PATCH] moved FUpdateSettings to the right place --- FModel/FModel_Main.xaml.cs | 10 ---------- FModel/Program.cs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/FModel/FModel_Main.xaml.cs b/FModel/FModel_Main.xaml.cs index 04a98999..89b8f280 100644 --- a/FModel/FModel_Main.xaml.cs +++ b/FModel/FModel_Main.xaml.cs @@ -39,16 +39,6 @@ namespace FModel AutoUpdater.CheckForUpdateEvent += UIHelper.AutoUpdaterOnCheckForUpdateEvent; AutoUpdater.Start("https://dl.dropbox.com/s/3kv2pukqu6tj1r0/FModel.xml?dl=0"); - // Copy user settings from previous application version if necessary - if (FProp.Default.FUpdateSettings) - { - FProp.Default.Upgrade(); - FProp.Default.FUpdateSettings = false; - FProp.Default.Save(); - - DebugHelper.WriteLine("User settings copied from previous version"); - } - DebugHelper.WriteUserSettings(); await Task.Run(() => diff --git a/FModel/Program.cs b/FModel/Program.cs index 7219f68d..53500019 100644 --- a/FModel/Program.cs +++ b/FModel/Program.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; +using FProp = FModel.Properties.Settings; namespace FModel { @@ -98,7 +99,18 @@ namespace FModel get { string filename = string.Format("FModel-Log-{0:yyyy-MM-dd}.txt", DateTime.Now); + + // Copy user settings from previous application version if necessary + if (FProp.Default.FUpdateSettings) + { + FProp.Default.Upgrade(); + FProp.Default.FUpdateSettings = false; + FProp.Default.Save(); + + DebugHelper.WriteLine("User settings copied from previous version"); + } FoldersUtility.LoadFolders(); + return Path.Combine(Properties.Settings.Default.FOutput_Path + "\\Logs", filename); } }