startup folder and config folder beeing identical is no longer a supported scenaria

This commit is contained in:
Frank Skare
2019-07-29 22:48:08 +02:00
parent 9c6c0f3506
commit 0f5146e58c
4 changed files with 13 additions and 9 deletions

View File

@@ -138,14 +138,14 @@ namespace mpvnet
get {
if (_ConfigFolder == null)
{
_ConfigFolder = PathHelp.StartupPath + "portable_config\\";
string portableFolder = PathHelp.StartupPath + "portable_config\\";
_ConfigFolder = portableFolder;
if (!Directory.Exists(_ConfigFolder))
_ConfigFolder = RegHelp.GetString(App.RegPath, "ConfigFolder");
if (!Directory.Exists(_ConfigFolder))
{
string portableFolder = PathHelp.StartupPath + "portable_config\\";
string appdataFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv.net\\";
string appdataFolderMpv = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\mpv\\";
@@ -165,6 +165,7 @@ namespace mpvnet
using (var d = new WinForms.FolderBrowserDialog())
{
d.Description = "Choose a folder.";
if (d.ShowDialog() == WinForms.DialogResult.OK)
_ConfigFolder = d.SelectedPath + "\\";
else
@@ -173,6 +174,12 @@ namespace mpvnet
}
}
if (PathHelp.StartupPath == _ConfigFolder)
{
Msg.ShowError("Startup folder and config folder cannot be identical, using portable_config instead.");
_ConfigFolder = portableFolder;
}
if (!Directory.Exists(_ConfigFolder))
Directory.CreateDirectory(_ConfigFolder);