diff --git a/src/client/DCSInsight/MainWindow.xaml.cs b/src/client/DCSInsight/MainWindow.xaml.cs index 79d48c1..494d7fe 100644 --- a/src/client/DCSInsight/MainWindow.xaml.cs +++ b/src/client/DCSInsight/MainWindow.xaml.cs @@ -42,6 +42,8 @@ public partial class MainWindow : Window, IErrorListener, IConnectionListener, I public MainWindow() { InitializeComponent(); + Settings.Default.DCSBiosJSONLocation = Environment.ExpandEnvironmentVariables(Settings.Default.DCSBiosJSONLocation); + Settings.Default.Save(); ICEventHandler.AttachErrorListener(this); ICEventHandler.AttachConnectionListener(this); ICEventHandler.AttachDataListener(this); @@ -72,7 +74,7 @@ private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) Top = Settings.Default.MainWindowTop.CompareTo(-1) == 0 ? Top : Settings.Default.MainWindowTop; Left = Settings.Default.MainWindowLeft.CompareTo(-1) == 0 ? Left : Settings.Default.MainWindowLeft; - ButtonLuaWindow.Visibility = Directory.Exists(Environment.ExpandEnvironmentVariables(Settings.Default.DCSBiosJSONLocation)) ? Visibility.Visible : Visibility.Collapsed; + ButtonLuaWindow.Visibility = Directory.Exists(Settings.Default.DCSBiosJSONLocation) ? Visibility.Visible : Visibility.Collapsed; _formLoaded = true; } catch (Exception ex) diff --git a/src/client/DCSInsight/Windows/SettingsWindow.xaml.cs b/src/client/DCSInsight/Windows/SettingsWindow.xaml.cs index 20bedcc..0a1c69f 100644 --- a/src/client/DCSInsight/Windows/SettingsWindow.xaml.cs +++ b/src/client/DCSInsight/Windows/SettingsWindow.xaml.cs @@ -95,7 +95,7 @@ private void ButtonOk_OnClick(object sender, RoutedEventArgs e) if (DCSBIOSChanged) { - Settings.Default.DCSBiosJSONLocation = TextBoxDcsBiosJSONLocation.Text; + Settings.Default.DCSBiosJSONLocation = Environment.ExpandEnvironmentVariables(TextBoxDcsBiosJSONLocation.Text); Settings.Default.Save(); } DialogResult = true;