mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2025-07-25 04:43:58 +00:00
fixes #6 - users can now have a download folder outside of MO2
This commit is contained in:
@ -13,6 +13,8 @@ that is copied directly into a modfile (commonly used for `SSE Terrain Tamriel.e
|
|||||||
* All `.json`, `.ini`, and `.yaml` files that contain remappable paths are now inlined and remapped.
|
* All `.json`, `.ini`, and `.yaml` files that contain remappable paths are now inlined and remapped.
|
||||||
* If Wabbajack finds a file called `otherprofiles.txt` inside the compile'd profile's folder. Then that file is assumed
|
* If Wabbajack finds a file called `otherprofiles.txt` inside the compile'd profile's folder. Then that file is assumed
|
||||||
to be a list of other profiles to be included in the install. This list should be the name of a profile, one name per line.
|
to be a list of other profiles to be included in the install. This list should be the name of a profile, one name per line.
|
||||||
|
* Can now set the download folder both during compilation and installation.
|
||||||
|
* Any config files pointing to the download folder are remapped.
|
||||||
|
|
||||||
#### Version 0.8.1 - 8/29/2019
|
#### Version 0.8.1 - 8/29/2019
|
||||||
* Fixed a bug that was causing VFS temp folders not to be cleaned
|
* Fixed a bug that was causing VFS temp folders not to be cleaned
|
||||||
|
@ -42,6 +42,10 @@ namespace Wabbajack.Common
|
|||||||
public static string MO2_PATH_MAGIC_DOUBLE_BACK = "{--||MO2_PATH_MAGIC_DOUBLE_BACK||--}";
|
public static string MO2_PATH_MAGIC_DOUBLE_BACK = "{--||MO2_PATH_MAGIC_DOUBLE_BACK||--}";
|
||||||
public static string MO2_PATH_MAGIC_FORWARD = "{--||MO2_PATH_MAGIC_FORWARD||--}";
|
public static string MO2_PATH_MAGIC_FORWARD = "{--||MO2_PATH_MAGIC_FORWARD||--}";
|
||||||
|
|
||||||
|
public static string DOWNLOAD_PATH_MAGIC_BACK = "{--||DOWNLOAD_PATH_MAGIC_BACK||--}";
|
||||||
|
public static string DOWNLOAD_PATH_MAGIC_DOUBLE_BACK = "{--||DOWNLOAD_PATH_MAGIC_DOUBLE_BACK||--}";
|
||||||
|
public static string DOWNLOAD_PATH_MAGIC_FORWARD = "{--||DOWNLOAD_PATH_MAGIC_FORWARD||--}";
|
||||||
|
|
||||||
|
|
||||||
public static String AppName = "Wabbajack";
|
public static String AppName = "Wabbajack";
|
||||||
public static string HashCacheName = "Wabbajack.hash_cache";
|
public static string HashCacheName = "Wabbajack.hash_cache";
|
||||||
|
@ -80,6 +80,7 @@ namespace Wabbajack
|
|||||||
private string _modListName;
|
private string _modListName;
|
||||||
private ModList _modList;
|
private ModList _modList;
|
||||||
private string _location;
|
private string _location;
|
||||||
|
private string _downloadLocation;
|
||||||
|
|
||||||
public string ModListName
|
public string ModListName
|
||||||
{
|
{
|
||||||
@ -107,6 +108,19 @@ namespace Wabbajack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string DownloadLocation
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _downloadLocation;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_downloadLocation = value;
|
||||||
|
OnPropertyChanged("DownloadLocation");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string _htmlReport;
|
private string _htmlReport;
|
||||||
public Visibility ShowReportButton => _htmlReport == null ? Visibility.Collapsed : Visibility.Visible;
|
public Visibility ShowReportButton => _htmlReport == null ? Visibility.Collapsed : Visibility.Visible;
|
||||||
|
|
||||||
@ -243,6 +257,19 @@ namespace Wabbajack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ICommand _changeDownloadPath;
|
||||||
|
public ICommand ChangeDownloadPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_changeDownloadPath == null)
|
||||||
|
{
|
||||||
|
_changeDownloadPath = new LambdaCommand(() => true, () => this.ExecuteChangeDownloadPath());
|
||||||
|
}
|
||||||
|
return _changeDownloadPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ExecuteChangePath()
|
private void ExecuteChangePath()
|
||||||
{
|
{
|
||||||
if (Mode == "Installing")
|
if (Mode == "Installing")
|
||||||
@ -268,6 +295,17 @@ namespace Wabbajack
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ExecuteChangeDownloadPath()
|
||||||
|
{
|
||||||
|
var ofd = new Ookii.Dialogs.Wpf.VistaFolderBrowserDialog();
|
||||||
|
ofd.Description = "Select a location for MO2 downloads";
|
||||||
|
ofd.UseDescriptionForTitle = true;
|
||||||
|
if (ofd.ShowDialog() == true)
|
||||||
|
{
|
||||||
|
DownloadLocation = ofd.SelectedPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ConfigureForBuild()
|
private void ConfigureForBuild()
|
||||||
{
|
{
|
||||||
var profile_folder = Path.GetDirectoryName(Location);
|
var profile_folder = Path.GetDirectoryName(Location);
|
||||||
@ -278,6 +316,10 @@ namespace Wabbajack
|
|||||||
var profile_name = Path.GetFileName(profile_folder);
|
var profile_name = Path.GetFileName(profile_folder);
|
||||||
ModListName = profile_name;
|
ModListName = profile_name;
|
||||||
Mode = "Building";
|
Mode = "Building";
|
||||||
|
|
||||||
|
var tmp_compiler = new Compiler(mo2folder, Utils.Log);
|
||||||
|
DownloadLocation = tmp_compiler.MO2DownloadsFolder;
|
||||||
|
|
||||||
_mo2Folder = mo2folder;
|
_mo2Folder = mo2folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,6 +365,7 @@ namespace Wabbajack
|
|||||||
{
|
{
|
||||||
var installer = new Installer(_modList, Location, msg => this.LogMsg(msg));
|
var installer = new Installer(_modList, Location, msg => this.LogMsg(msg));
|
||||||
installer.IgnoreMissingFiles = IgnoreMissingFiles;
|
installer.IgnoreMissingFiles = IgnoreMissingFiles;
|
||||||
|
installer.DownloadFolder = DownloadLocation;
|
||||||
var th = new Thread(() =>
|
var th = new Thread(() =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -31,12 +31,19 @@ namespace Wabbajack
|
|||||||
|
|
||||||
public bool IgnoreMissingFiles { get; set; }
|
public bool IgnoreMissingFiles { get; set; }
|
||||||
|
|
||||||
|
private string _mo2DownloadsFolder;
|
||||||
public string MO2DownloadsFolder
|
public string MO2DownloadsFolder
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
if (_mo2DownloadsFolder != null) return _mo2DownloadsFolder;
|
||||||
|
if (MO2Ini != null)
|
||||||
|
if (MO2Ini.Settings != null)
|
||||||
|
if (MO2Ini.Settings.download_directory != null)
|
||||||
|
return MO2Ini.Settings.download_directory.Replace("/", "\\");
|
||||||
return Path.Combine(MO2Folder, "downloads");
|
return Path.Combine(MO2Folder, "downloads");
|
||||||
}
|
}
|
||||||
|
set => _mo2DownloadsFolder = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -157,6 +164,9 @@ namespace Wabbajack
|
|||||||
Info($"Indexing {GamePath}");
|
Info($"Indexing {GamePath}");
|
||||||
VFS.AddRoot(GamePath);
|
VFS.AddRoot(GamePath);
|
||||||
|
|
||||||
|
Info($"Indexing {MO2DownloadsFolder}");
|
||||||
|
VFS.AddRoot(MO2DownloadsFolder);
|
||||||
|
|
||||||
var mo2_files = Directory.EnumerateFiles(MO2Folder, "*", SearchOption.AllDirectories)
|
var mo2_files = Directory.EnumerateFiles(MO2Folder, "*", SearchOption.AllDirectories)
|
||||||
.Where(p => p.FileExists())
|
.Where(p => p.FileExists())
|
||||||
.Select(p => new RawSourceFile(VFS.Lookup(p)) { Path = p.RelativeTo(MO2Folder)});
|
.Select(p => new RawSourceFile(VFS.Lookup(p)) { Path = p.RelativeTo(MO2Folder)});
|
||||||
@ -497,7 +507,7 @@ namespace Wabbajack
|
|||||||
|
|
||||||
Info($"Checking link for {found.Name}");
|
Info($"Checking link for {found.Name}");
|
||||||
|
|
||||||
var installer = new Installer(null, "", s=>Utils.Log(s));
|
var installer = new Installer(null, "", Utils.Log);
|
||||||
installer.NexusAPIKey = NexusKey;
|
installer.NexusAPIKey = NexusKey;
|
||||||
if (!installer.DownloadArchive(result, false))
|
if (!installer.DownloadArchive(result, false))
|
||||||
Error($"Unable to resolve link for {found.Name}. If this is hosted on the nexus the file may have been removed.");
|
Error($"Unable to resolve link for {found.Name}. If this is hosted on the nexus the file may have been removed.");
|
||||||
@ -530,7 +540,7 @@ namespace Wabbajack
|
|||||||
private IEnumerable<Func<RawSourceFile, Directive>> MakeStack()
|
private IEnumerable<Func<RawSourceFile, Directive>> MakeStack()
|
||||||
{
|
{
|
||||||
Info("Generating compilation stack");
|
Info("Generating compilation stack");
|
||||||
return new List<Func<RawSourceFile, Directive>>()
|
return new List<Func<RawSourceFile, Directive>>
|
||||||
{
|
{
|
||||||
IgnoreStartsWith("logs\\"),
|
IgnoreStartsWith("logs\\"),
|
||||||
IncludeRegex("^downloads\\\\.*\\.meta"),
|
IncludeRegex("^downloads\\\\.*\\.meta"),
|
||||||
@ -646,6 +656,11 @@ namespace Wabbajack
|
|||||||
data = data.Replace(MO2Folder, Consts.MO2_PATH_MAGIC_BACK);
|
data = data.Replace(MO2Folder, Consts.MO2_PATH_MAGIC_BACK);
|
||||||
data = data.Replace(MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK);
|
data = data.Replace(MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK);
|
||||||
data = data.Replace(MO2Folder.Replace("\\", "/"), Consts.MO2_PATH_MAGIC_FORWARD);
|
data = data.Replace(MO2Folder.Replace("\\", "/"), Consts.MO2_PATH_MAGIC_FORWARD);
|
||||||
|
|
||||||
|
data = data.Replace(MO2DownloadsFolder, Consts.DOWNLOAD_PATH_MAGIC_BACK);
|
||||||
|
data = data.Replace(MO2DownloadsFolder.Replace("\\", "\\\\"), Consts.DOWNLOAD_PATH_MAGIC_DOUBLE_BACK);
|
||||||
|
data = data.Replace(MO2DownloadsFolder.Replace("\\", "/"), Consts.DOWNLOAD_PATH_MAGIC_FORWARD);
|
||||||
|
|
||||||
if (data == original_data)
|
if (data == original_data)
|
||||||
return null;
|
return null;
|
||||||
var result = source.EvolveTo<RemappedInlineFile>();
|
var result = source.EvolveTo<RemappedInlineFile>();
|
||||||
|
@ -18,6 +18,8 @@ namespace Wabbajack
|
|||||||
{
|
{
|
||||||
public class Installer
|
public class Installer
|
||||||
{
|
{
|
||||||
|
private string _downloadsFolder;
|
||||||
|
|
||||||
public VirtualFileSystem VFS
|
public VirtualFileSystem VFS
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@ -36,10 +38,8 @@ namespace Wabbajack
|
|||||||
public string Outputfolder { get; }
|
public string Outputfolder { get; }
|
||||||
public string DownloadFolder
|
public string DownloadFolder
|
||||||
{
|
{
|
||||||
get
|
get => _downloadsFolder ?? Path.Combine(Outputfolder, "downloads");
|
||||||
{
|
set => _downloadsFolder = value;
|
||||||
return Path.Combine(Outputfolder, "downloads");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public ModList ModList { get; }
|
public ModList ModList { get; }
|
||||||
public Action<string> Log_Fn { get; }
|
public Action<string> Log_Fn { get; }
|
||||||
@ -309,8 +309,11 @@ namespace Wabbajack
|
|||||||
data = data.Replace(Consts.MO2_PATH_MAGIC_DOUBLE_BACK, Outputfolder.Replace("\\", "\\\\"));
|
data = data.Replace(Consts.MO2_PATH_MAGIC_DOUBLE_BACK, Outputfolder.Replace("\\", "\\\\"));
|
||||||
data = data.Replace(Consts.MO2_PATH_MAGIC_FORWARD, Outputfolder.Replace("\\", "/"));
|
data = data.Replace(Consts.MO2_PATH_MAGIC_FORWARD, Outputfolder.Replace("\\", "/"));
|
||||||
|
|
||||||
|
data = data.Replace(Consts.DOWNLOAD_PATH_MAGIC_BACK, DownloadFolder);
|
||||||
|
data = data.Replace(Consts.DOWNLOAD_PATH_MAGIC_DOUBLE_BACK, DownloadFolder.Replace("\\", "\\\\"));
|
||||||
|
data = data.Replace(Consts.DOWNLOAD_PATH_MAGIC_FORWARD, DownloadFolder.Replace("\\", "/"));
|
||||||
|
|
||||||
File.WriteAllText(Path.Combine(Outputfolder, directive.To), data);
|
File.WriteAllText(Path.Combine(Outputfolder, directive.To), data);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BuildFolderStructure()
|
private void BuildFolderStructure()
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Wabbajack"
|
xmlns:local="clr-namespace:Wabbajack"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Wabbajack" Height="700" Width="800"
|
Title="Wabbajack" Height="800" Width="800"
|
||||||
Style="{StaticResource {x:Type Window}}" Icon="square_transparent_icon.ico" WindowStyle="ToolWindow" Closing="Window_Closing">
|
Style="{StaticResource {x:Type Window}}" Icon="square_transparent_icon.ico" WindowStyle="ToolWindow" Closing="Window_Closing">
|
||||||
<Grid Margin="16">
|
<Grid Margin="16">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@ -30,9 +30,17 @@
|
|||||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||||
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
<ColumnDefinition Width="Auto"></ColumnDefinition>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Content="Location:" Grid.Column="0"></Label>
|
<Grid.RowDefinitions>
|
||||||
<TextBox Grid.Column="1" Text="{Binding Location}"></TextBox>
|
<RowDefinition></RowDefinition>
|
||||||
<Button Content="Select" MinWidth="80" Grid.Column="2" Command="{Binding ChangePath}"></Button>
|
<RowDefinition MinHeight="10"></RowDefinition>
|
||||||
|
<RowDefinition></RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Label Grid.Row="0" Content="MO2 Location:" Grid.Column="0"></Label>
|
||||||
|
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Location}"></TextBox>
|
||||||
|
<Button Grid.Row="0" Content="Select" MinWidth="80" Grid.Column="2" Command="{Binding ChangePath}"></Button>
|
||||||
|
<Label Grid.Row="2" Content="Download Location:" Grid.Column="0"></Label>
|
||||||
|
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DownloadLocation}"></TextBox>
|
||||||
|
<Button Grid.Row="2" Content="Select" MinWidth="80" Grid.Column="2" Command="{Binding ChangeDownloadPath}"></Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
<ListBox Grid.Row ="2" ItemsSource="{Binding Status}" Width="Auto" HorizontalAlignment="Stretch">
|
<ListBox Grid.Row ="2" ItemsSource="{Binding Status}" Width="Auto" HorizontalAlignment="Stretch">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
|
Reference in New Issue
Block a user