diff --git a/CHANGELOG.md b/CHANGELOG.md index 73ad03fa..a5a44aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Mzinga ChangeLog # +## next ## + +* Viewer: Fixed bug with creating folder to save config + ## v0.11.0 ## * Engine/Viewer: Fixed bug where loading default config looked in working directory, not app entrypoint diff --git a/src/Mzinga.Viewer/App.axaml.cs b/src/Mzinga.Viewer/App.axaml.cs index 89dd691a..fa1c1b04 100644 --- a/src/Mzinga.Viewer/App.axaml.cs +++ b/src/Mzinga.Viewer/App.axaml.cs @@ -104,7 +104,7 @@ private ViewerConfig LoadConfig() try { - using FileStream inputStream = new FileStream(ViewerConfigPath, FileMode.OpenOrCreate); + using FileStream inputStream = new FileStream(ViewerConfigPath, FileMode.Open); viewerConfig.LoadConfig(inputStream); } catch (Exception) { } @@ -116,6 +116,7 @@ private void SaveConfig() { try { + Directory.CreateDirectory(Path.GetDirectoryName(ViewerConfigPath)); using FileStream outputStream = new FileStream(ViewerConfigPath, FileMode.Create); AppVM.ViewerConfig.InternalEngineConfig.CopyOptionsFrom(InternalEngineConfig.GetOptionsClone()); // Repopulate with current engine values AppVM.ViewerConfig.SaveConfig(outputStream);