mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Blocks installations into folders /w .wabbajack file
This commit is contained in:
parent
caffb6e032
commit
7c88b4ea12
@ -144,7 +144,7 @@ namespace Wabbajack.CacheServer
|
||||
{
|
||||
foreach (var list in modlists)
|
||||
{
|
||||
var modlist_path = Path.Combine(Consts.ModListDownloadFolder, list.Links.MachineURL + ".wabbajack");
|
||||
var modlist_path = Path.Combine(Consts.ModListDownloadFolder, list.Links.MachineURL + ExtensionManager.Extension);
|
||||
|
||||
if (list.NeedsDownload(modlist_path))
|
||||
{
|
||||
|
@ -318,5 +318,20 @@ namespace Wabbajack.Lib
|
||||
|
||||
File.WriteAllText(Path.Combine(OutputFolder, directive.To), data);
|
||||
}
|
||||
|
||||
public static IErrorResponse CheckValidInstallPath(string path)
|
||||
{
|
||||
var ret = Utils.IsDirectoryPathValid(path);
|
||||
if (!ret.Succeeded) return ret;
|
||||
foreach (var file in Directory.EnumerateFiles(path, DirectoryEnumerationOptions.Recursive))
|
||||
{
|
||||
if (!File.Exists(file)) continue;
|
||||
if (System.IO.Path.GetExtension(file).Equals(ExtensionManager.Extension))
|
||||
{
|
||||
return ErrorResponse.Fail($"Cannot install into a folder with a wabbajack modlist inside of it.");
|
||||
}
|
||||
}
|
||||
return ErrorResponse.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace Wabbajack
|
||||
PromptTitle = "Select Installation Directory",
|
||||
};
|
||||
Location.AdditionalError = this.WhenAny(x => x.Location.TargetPath)
|
||||
.Select(x => Utils.IsDirectoryPathValid(x));
|
||||
.Select(x => MO2Installer.CheckValidInstallPath(x));
|
||||
DownloadLocation = new FilePickerVM()
|
||||
{
|
||||
ExistCheckOption = FilePickerVM.CheckOptions.Off,
|
||||
|
Loading…
Reference in New Issue
Block a user