mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-07-05 22:40:41 +12:00
Fix initial config creation when no config exists yet
This commit is contained in:
parent
77bc221455
commit
5a5bdb2410
|
@ -215,7 +215,14 @@ namespace SystemTrayMenu.Properties
|
||||||
userSettings.Add(group);
|
userSettings.Add(group);
|
||||||
config.Add(userSettings);
|
config.Add(userSettings);
|
||||||
doc.Add(config);
|
doc.Add(config);
|
||||||
doc.Declaration = declaration;
|
doc.Declaration = declaration;
|
||||||
|
|
||||||
|
string? dir = Path.GetDirectoryName(path);
|
||||||
|
if (!Directory.Exists(dir))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(dir!);
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
doc.Save(path);
|
doc.Save(path);
|
||||||
|
|
Loading…
Reference in a new issue