diff --git a/App.config b/App.config index cada091..b27d2c8 100644 --- a/App.config +++ b/App.config @@ -34,6 +34,9 @@ + + True + \ No newline at end of file diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 7a8c585..e7200bc 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -22,6 +22,7 @@ public partial class MainWindow : Window public MainWindow() { InitializeComponent(); + CheckForUserSettingsUpgrade(); DataContext = new MainWindowViewModel() { IsDebugEnabled = Properties.Settings.Default.IsDebugEnabled, @@ -154,6 +155,18 @@ public partial class MainWindow : Window } } + private static void CheckForUserSettingsUpgrade() + { + if (!Properties.Settings.Default.UserSettingsUpgradeRequired) + { + return; + } + + Properties.Settings.Default.Upgrade(); + Properties.Settings.Default.UserSettingsUpgradeRequired = false; + Properties.Settings.Default.Save(); + } + private void ShowSetupInstructionsDialog() { var dataContext = (MainWindowViewModel)DataContext; diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs index 98efe17..fdc093f 100644 --- a/Properties/Settings.Designer.cs +++ b/Properties/Settings.Designer.cs @@ -130,5 +130,17 @@ namespace WpfMaiTouchEmulator.Properties { this["BorderColour"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool UserSettingsUpgradeRequired { + get { + return ((bool)(this["UserSettingsUpgradeRequired"])); + } + set { + this["UserSettingsUpgradeRequired"] = value; + } + } } } diff --git a/Properties/Settings.settings b/Properties/Settings.settings index 03fb6b6..fd5c6c9 100644 --- a/Properties/Settings.settings +++ b/Properties/Settings.settings @@ -29,5 +29,8 @@ + + True + \ No newline at end of file