startup folder and config folder beeing identical is no longer a supported scenaria
This commit is contained in:
@@ -13,13 +13,10 @@
|
||||
- 'Tools > Manage File Associations' was replaced by 'Tools > OS Setup',
|
||||
it has now a feature to add and remove mpv.net to and from the Path
|
||||
environment variable and the OS default apps settings can be opened (Win 10 only)
|
||||
- startup folder and config folder beeing identical is no longer
|
||||
a supported scenaria because it's a brain-dead idea
|
||||
- Error messages are shown when unknown scripts and extensions are found in the startup folder
|
||||
because user scripts and extensions are supposed to be located in the config folder instead
|
||||
- when the config folder and the startup folder were identical then extensions were loaded
|
||||
twice and script were loaded four times because the script host is an extension, there is
|
||||
now a check to ensure extensions and scripts are only loaded once. On first start there
|
||||
is no longer an option to select the startup folder as config folder, it's still possible
|
||||
using a custom folder but discouraged
|
||||
|
||||
### 5.0
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace ScriptingExtension // the file name of extensions must end with 'Exten
|
||||
if (Directory.Exists(mp.ConfigFolder + "scripts"))
|
||||
scriptFiles.AddRange(Directory.GetFiles(mp.ConfigFolder + "scripts", "*.cs"));
|
||||
|
||||
if (Directory.Exists(PathHelp.StartupPath + "scripts") && mp.ConfigFolder != PathHelp.StartupPath)
|
||||
if (Directory.Exists(PathHelp.StartupPath + "scripts"))
|
||||
foreach (string file in Directory.GetFiles(PathHelp.StartupPath + "scripts", "*.cs"))
|
||||
App.UnknownModule(file);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace mpvnet
|
||||
|
||||
dir = mp.ConfigFolder + "Extensions";
|
||||
|
||||
if (Directory.Exists(dir) && mp.ConfigFolder != PathHelp.StartupPath)
|
||||
if (Directory.Exists(dir))
|
||||
foreach (string i in Directory.GetDirectories(dir))
|
||||
catalog.Catalogs.Add(new DirectoryCatalog(i, "*Extension.dll"));
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user