This commit is contained in:
Timothy Baldridge 2019-09-26 17:08:23 -06:00
commit 7c4c2a586c
22 changed files with 346 additions and 135 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "OMOD-Extractor"]
path = OMOD-Extractor
url = https://github.com/erri120/OMOD-Extractor

View File

@ -12,6 +12,7 @@
* Added support for `.exe` installers
* Rework UI to support a slideshow of used mods during installation and compilation
* Remove support for extracting `.exe` installers
* Added support for `.omod` files
#### Version 0.9.2 - 9/18/2013
* Fixed a bug with BSA string encoding

View File

@ -1,6 +1,6 @@
# Contributing to Wabbajack
The following is a set of guidelines for contributing to the `halgari/wabbajack` repo on Github. These are guildeines but not rules so be free to propose changes.
The following is a set of guidelines for contributing to the `halgari/wabbajack` repo on GitHub. These are guidelines but not rules so be free to propose changes.
## How Can I Contribute?
@ -39,11 +39,12 @@ You can download it [here](https://visualstudio.microsoft.com/vs/) but make sure
The installer may have selected other options as well but these are the most important ones.
### Starting developement
### Starting development
1) **Fork and clone the project:** go to the Github repo page, click the fork button, copy the url from the forked repo, navigate to your project folder, open Git Bash or normal command prompt and type `git clone url name` and replace url with the copied url and name with the folder name
2) **Open Wabbajack.sln** in Visual Studio 2019
3) **Download NuGet Packages** by selecting the solution and *Right Click*->*Restore NuGet Packages*
2) **Initialize the submodules** using `git submodule init` and `git submodule update`
3) **Open Wabbajack.sln** in Visual Studio 2019
4) **Download NuGet Packages** by selecting the solution and *Right Click*->*Restore NuGet Packages*
It may take a while for Visual Studio to download all packages and update all References so be patience. Once all packages are downloaded go and try building Wabbajack. If the build is successful than good job, if not head over to the *#wabbajack-development* channel on the discord and talk about your build error.

1
OMOD-Extractor Submodule

@ -0,0 +1 @@
Subproject commit a3eb3584527e4363a02607d38e91c646316b1cea

169
README.md
View File

@ -1,4 +1,5 @@
## Wabbajack - An automated modlist installer for TES/Fallout games
[![Build Status](https://dev.azure.com/tbaldridge/tbaldridge/_apis/build/status/halgari.wabbajack?branchName=master)](https://dev.azure.com/tbaldridge/tbaldridge/_build/latest?definitionId=1&branchName=master)
The general idea behind this program is fairly simple. Given a Mod Organizer 2 folder and profile, generate list of instructions that will allow
@ -7,73 +8,77 @@ files or syncing data between the source and destination machine. The end result
rights of the game publisher and the mod authors.
### Social Links
- [Discord](https://discord.gg/zgbrkmA)
- [Patreon](https://www.patreon.com/user?u=11907933) Check this page for updates and to vote on features
### What Wabbajack can do
At this point you may be wondering how much of a complex modlist Wabbajack can handle. At this point it's more about what Wabbajack *can't* handle, but
let's do a rundown of all the supported features:
* Support for the following games is tested on a regular basis
* Fallout 4
* Fallout New Vegas
* Skyrim SE
* Skyrim LE
* Support for automatic downloads from the following sources
* Nexus Mods (Premium accounts only)
* Dropbox
* Google Drive
* Mega
* ModDB
* Direct URLs (with custom header support)
* Support the following archive types
* .zip
* .7z
* .rar
* The following mod installation types are supported
* Files installed with our without fomod isntallers
* Manually installed mods
* Renamed/deleted/moved files are detected and handled
* Multiple mods installed into the same mod folder
* A mod split across multiple mod folders
* Any tools installed in the MO2 folder. Want your users to have BethIni or xEdit? Just put them in a folder inside the MO2 install folder
* ENBseries files that exist in the game folder
* SKSE install
* The following situations are automatically detected and handled by the automated binary patcher (not an exhaustive list)
* ESP cleaning
* form 44 conversion
* ESP to ESL conversion
* Adding masters
* Dummy ESPs created by CAO
* (really any ESP modifications are handled)
* Mesh fixing
* Texture compression / fixing
- Support for the following games is tested on a regular basis
- Fallout 4
- Fallout New Vegas
- Skyrim SE
- Skyrim LE
- Support for automatic downloads from the following sources
- Nexus Mods (Premium accounts only)
- Dropbox
- Google Drive
- Mega
- ModDB
- Direct URLs (with custom header support)
- Support the following archive types
- `.zip`
- `.7z`
- `.rar`
- `.fomod` (FNV archives)
- The following mod installation types are supported
- Files installed with our without fomod installers
- Files from `.omod` mods like `DarNified UI` or `DarkUId Darn`
- Manually installed mods
- Renamed/deleted/moved files are detected and handled
- Multiple mods installed into the same mod folder
- A mod split across multiple mod folders
- Any tools installed in the MO2 folder. Want your users to have BethIni or xEdit? Just put them in a folder inside the MO2 install folder
- ENBseries files that exist in the game folder
- SKSE install
- The following situations are automatically detected and handled by the automated binary patcher (not an exhaustive list)
- ESP cleaning
- form 44 conversion
- ESP to ESL conversion
- Adding masters
- Dummy ESPs created by CAO
- (really any ESP modifications are handled)
- Mesh fixing
- Texture compression / fixing
The following BSA operations are detected by extracting or creating BSAs via Wabbajack's custom BSA routines
* BSA Unpacking
* BSA Creation (packing loose files)
* BSA repacking (unpacking, fixing files and repacking)
- BSA Unpacking
- BSA Creation (packing loose files)
- BSA repacking (unpacking, fixing files and repacking)
That being said, there are some cases where we would need to do a bit more work to develop:
* Manually downloaded files
* LL Files (currently no plans to implement)
* esp to esm conversion (there are hacks for this)
* binary patching of non-bsa huge files. 256MB is the largest size Wabbajack can currently handle with the binary patcher
- Manually downloaded files
- LL Files (currently no plans to implement)
- esp to esm conversion (there are hacks for this)
- binary patching of non-bsa huge files. 256MB is the largest size Wabbajack can currently handle with the binary patcher
### Creating a ModList Installer
Overview video [`https://www.youtube.com/watch?v=5Fwr0Chtcuc`]
Overview video [`https://www.youtube.com/watch?v=5Fwr0Chtcuc`](https://www.youtube.com/watch?v=5Fwr0Chtcuc)
1) Download Wabbajack and install it somewhere outside of your normal Mod Organizer 2 folder
(otherwise Wabbajack will try to figure out how to install itself and that might cuase a collapse in the time-space
(otherwise Wabbajack will try to figure out how to install itself and that might cause a collapse in the time-space
continuum).
2) Make sure every archive you used in your MO2 profile has some sort of download information attached.
* If the file was downloaded via MO2 you're good, no extra work is needed
* If the file was downloaded manually from the Nexus, copy it into the MO2 downloads folder, go back to MO2
* and go to the `downloads` tab. Find the file and click `Query Info` from the right-click menu. MO2 should find
- If the file was downloaded via MO2 you're good, no extra work is needed
- If the file was downloaded manually from the Nexus, copy it into the MO2 downloads folder, go back to MO2
- and go to the `downloads` tab. Find the file and click `Query Info` from the right-click menu. MO2 should find
the download info for you
* For other files (ENBSeries, SKSE, SRO, etc.) Look at the [`RECIPES.md`] file
* for instructions specific to your file source.
- For other files (ENBSeries, SKSE, SRO, etc.) Look at the [`RECIPES.md`] file
- for instructions specific to your file source.
3) Now load Wabbajack, and point it to the `\<MO2 Folder>\mods\<your profile>\modlist.txt` file.
4) Click `Begin`.
5) Wabbajack will start by indexing all your downloaded archives. This will take some time on most machines as the application
@ -92,6 +97,7 @@ will be auto installed and downloaded
4) After installation has completed, run `Mod Organizer 2.exe`, select `Portable` and your game type.
### How it works
At a technical level the process is as follows.
1) Hash and cache the contents of every archive in the `\downloads` folder. This lets Wabbajack know of all the possible locations where you could have installed mods
@ -100,48 +106,51 @@ At a technical level the process is as follows.
4) Attach the JSON file to Wabbajack itself, creating a new Auto-installer for the profile
### The Resolution Stack
Every file analyzed by Wabbajack is passed through a stack of rules. The first rule to match the file creates a `Install Directive` or a instruction on how to
install that specific file.
Every file analyzed by Wabbajack is passed through a stack of rules. The first rule to match the file creates a `Install Directive` or a instruction on how to install that specific file.
Currently the Resolution stack looks like this:
1) Ignore the contents of `logs\`
1) Directly include .meta files int the `downloads\` folder
2) Ignore the contents of `downloads\`
3) Ignore the contents of `webcache\`
4) Ignore the contents of `overwrite\`
2) Directly include .meta files int the `downloads\` folder
3) Ignore the contents of `downloads\`
4) Ignore the contents of `webcache\`
5) Ignore the contents of `overwrite\`
6) Ignore any files with `temporary_logs` as a folder in the path
5) Ignore `.pyc` files
7) Ignore `.pyc` files
8) Ignore `.log` files
6) Ignore any files in `profiles` that are not for the selected MO2 profile
7) Ignore any disabled mods
8) Include any profile settings for the selected profile by including them directly in the modlist
9) Ignore "ModOrganizer.ini", it will be re-created when MO2 starts on the new machine
10) Ignore "Data" in the Game directly (in your Steam folder)
11) Ignore "Papyrus Compiler" in the game folder
12) Ignore the "Skyrim" folder in the game folder
13) Ignore any BSAs in the game folder
14) Include all meta.ini files from all (selected) mods
15) Include archive and file meta information for any file that matches a file in an archive directly via a SHA256 comparison
9) Ignore any files in `profiles` that are not for the selected MO2 profile
10) Ignore any disabled mods
11) Include any profile settings for the selected profile by including them directly in the modlist
12) Ignore "ModOrganizer.ini", it will be re-created when MO2 starts on the new machine
13) Ignore "Data" in the Game directly (in your Steam folder)
14) Ignore "Papyrus Compiler" in the game folder
15) Ignore the "Skyrim" folder in the game folder
16) Ignore any BSAs in the game folder
17) Include all meta.ini files from all (selected) mods
18) Include archive and file meta information for any file that matches a file in an archive directly via a SHA256 comparison
19) Rip apart any `.bsa` files and run a mini resolution stack on the contents to figure out how to build the .bsa from the input files
16) Generate patches for files that may have been modified after being installed from an archive (see section on Patching for more info)
20) Generate patches for files that may have been modified after being installed from an archive (see section on Patching for more info)
21) Include dummy ESPs directly into the modlist
18) Ignore files in the game directory
19) Ignore .ini files
20) Ignore .html files (normally these are logs)
21) Ignore .txt files
22) Ignore `HavockBehaviourPostProcess.exe` this seems to get copied around by tools for some reason
22) Ignore files in the game directory
23) Ignore .ini files
24) Ignore .html files (normally these are logs)
25) Ignore .txt files
26) Ignore `HavockBehaviourPostProcess.exe` this seems to get copied around by tools for some reason
27) Ignore `splash.png` it's created for some games (like FO4) by MO2
23) Error for any file that survives to this point.
28) Error for any file that survives to this point.
So as you can see we handle a lot of possible install situations. See the section on [`Creating a Modpack`](README.md#Creating_a_ModList_Installer) for information on working with the installer
### Wabbajack Flags
The if the following words are found in a mod's notes or comments they trigger special behavior in Wabbajack.
* `WABBAJACK_INCLUDE` - All the files int he mod will be inlined into the installer
* `WABBAJAC_ALWAYS_ENABLE` - The mod's files will be considered by the compiler even if the mod is disabled in the profile
- `WABBAJACK_INCLUDE` - All the files int he mod will be inlined into the installer
- `WABBAJAC_ALWAYS_ENABLE` - The mod's files will be considered by the compiler even if the mod is disabled in the profile
### Patches
Wabbajack can create binary patches for files that have been modified after installation. This could be `.esp` files that have been cleaned or patched. Or
it could be meshes and textures that have been optimized to work better in a given game. In any case a BSDiff file is generated. The output of this process
is copied directly into the modlist instructions. However! It is important to note that the patch file is 100% useless without the source file. So `original + patch = final_file`. Without the original file, the final file cannot be recrated. This allows us to distribute arbitrary changes without violating copyrights as we do not copy
@ -194,13 +203,18 @@ implementation of some really nice features (like BSA packing). As such I made t
The end result is an app with a ton of features, and a less than professional UI. But that's my motto when coding "make it work, then make it pretty".
## Thanks to
Our tester and Discord members who encourage development and help test the builds.
### Patreon Supporters
#### Daedra level Patreon Supporters
* Ancalgon
- Ancalgon
#### Patreon Supporters
* Druwski
- Druwski
### License & Copyright
@ -209,4 +223,3 @@ retain their original copyrights. Note: Wabbajack installers contain code from W
the files behind any sort of paywall. You recieved this tool free of charge, respect this by giving freely as you were given.
[`RECIPES.md`]: https://github.com/halgari/wabbajack/blob/master/RECIPES.md

View File

@ -32,6 +32,26 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@ -31,6 +31,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="AlphaFS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
<HintPath>..\packages\AlphaFS.2.2.6\lib\net452\AlphaFS.dll</HintPath>

View File

@ -13,7 +13,8 @@ namespace Wabbajack.Common
public static string BSACreationDir = "TEMP_BSA_FILES";
public static string MegaPrefix = "https://mega.nz/#!";
public static HashSet<string> SupportedArchives = new HashSet<string> {".zip", ".rar", ".7z", ".7zip", ".fomod"};
public static HashSet<string> SupportedArchives = new HashSet<string> {".zip", ".rar", ".7z", ".7zip", ".fomod", ".omod"};
public static HashSet<string> SupportedBSAs = new HashSet<string> {".bsa"};
public static HashSet<string> ConfigFileExtensions = new HashSet<string> {".json", ".ini", ".yml"};

View File

@ -38,6 +38,8 @@ namespace Wabbajack.Common
ExtractAllWithBSA(source, dest);
else if (source.EndsWith(".exe"))
ExtractAllWithInno(source, dest);
else if (source.EndsWith(".omod"))
ExtractAllWithOMOD(source, dest);
else
ExtractAllWith7Zip(source, dest);
}
@ -48,6 +50,17 @@ namespace Wabbajack.Common
}
}
private static void ExtractAllWithOMOD(string source, string dest)
{
Utils.Log($"Extracting {Path.GetFileName(source)}");
OMODExtractorDLL.OMOD omod = new OMODExtractorDLL.OMOD(source, dest+"//", "temp");
omod.SaveConfig();
omod.SaveFile("script");
omod.SaveFile("readme");
omod.ExtractData();
omod.ExtractPlugins();
}
private static void ExtractAllWithBSA(string source, string dest)
{
try

View File

@ -24,7 +24,7 @@ namespace Wabbajack.Common
private static Action<string> _loggerFn;
private static Action<string, int> _statusFn;
private static readonly string[] Suffix = {"B", "KB", "MB", "GB", "TB", "PB", "EB"}; //Longs run out around EB
private static readonly string[] Suffix = {"B", "KB", "MB", "GB", "TB", "PB", "EB"}; // Longs run out around EB
public static void SetLoggerFn(Action<string> f)
{

View File

@ -107,6 +107,10 @@
<Project>{ff5d892f-8ff4-44fc-8f7f-cd58f307ad1b}</Project>
<Name>Compression.BSA</Name>
</ProjectReference>
<ProjectReference Include="..\OMOD-Extractor\OMODExtractorDLL\OMODExtractorDLL.csproj">
<Project>{eb003d18-dffb-49c7-b054-fb375345ae26}</Project>
<Name>OMODExtractorDLL</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="7z.dll" />

View File

@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.WebAutomation.Tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wabbajack.Test", "Wabbajack.Test\Wabbajack.Test.csproj", "{A47FFF32-782B-4D9F-8704-C98FB32FA8CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OMODExtractorDLL", "OMOD-Extractor\OMODExtractorDLL\OMODExtractorDLL.csproj", "{EB003D18-DFFB-49C7-B054-FB375345AE26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug (no commandargs)|Any CPU = Debug (no commandargs)|Any CPU
@ -89,8 +91,8 @@ Global
{BA2CFEA1-072B-42D6-822A-8C6D0E3AE5D9}.Release|x64.Build.0 = Release|x64
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|Any CPU.ActiveCfg = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|Any CPU.Build.0 = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|x64.ActiveCfg = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|x64.Build.0 = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|x64.ActiveCfg = Debug|x64
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug (no commandargs)|x64.Build.0 = Debug|x64
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -101,8 +103,8 @@ Global
{5128B489-BC28-4F66-9F0B-B4565AF36CBC}.Release|x64.Build.0 = Release|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|Any CPU.ActiveCfg = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|Any CPU.Build.0 = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|x64.ActiveCfg = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|x64.Build.0 = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|x64.ActiveCfg = Debug|x64
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug (no commandargs)|x64.Build.0 = Debug|x64
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2913DFE-18FF-468B-A6C1-55F7C0CC0CE8}.Debug|x64.ActiveCfg = Debug|Any CPU
@ -147,6 +149,18 @@ Global
{A47FFF32-782B-4D9F-8704-C98FB32FA8CC}.Release|Any CPU.Build.0 = Release|Any CPU
{A47FFF32-782B-4D9F-8704-C98FB32FA8CC}.Release|x64.ActiveCfg = Release|Any CPU
{A47FFF32-782B-4D9F-8704-C98FB32FA8CC}.Release|x64.Build.0 = Release|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug (no commandargs)|Any CPU.ActiveCfg = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug (no commandargs)|Any CPU.Build.0 = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug (no commandargs)|x64.ActiveCfg = Debug|x64
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug (no commandargs)|x64.Build.0 = Debug|x64
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug|x64.ActiveCfg = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Debug|x64.Build.0 = Debug|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Release|Any CPU.Build.0 = Release|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Release|x64.ActiveCfg = Release|Any CPU
{EB003D18-DFFB-49C7-B054-FB375345AE26}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -16,7 +16,7 @@ using Wabbajack.Properties;
namespace Wabbajack
{
internal class AppState : INotifyPropertyChanged
internal class AppState : INotifyPropertyChanged, IDataErrorInfo
{
private ICommand _begin;
@ -63,7 +63,7 @@ namespace Wabbajack
if (Assembly.GetEntryAssembly().Location.ToLower().Contains("\\downloads\\"))
{
MessageBox.Show(
"This app seems to be running inside a folder called `Downloads`, such folders are often highly monitored by Antivirus software and they can often " +
"This app seems to be running inside a folder called `Downloads`, such folders are often highly monitored by antivirus software and they can often " +
"conflict with the operations Wabbajack needs to perform. Please move this executable outside of your `Downloads` folder and then restart the app.",
"Cannot run inside `Downloads`",
MessageBoxButton.OK,
@ -158,6 +158,7 @@ namespace Wabbajack
}
}
public string DownloadLocation
{
get => _downloadLocation;
@ -244,7 +245,7 @@ namespace Wabbajack
}
}
private string _nexusSiteURL = null;
public string _nexusSiteURL = null;
private void VisitNexusSite()
{
@ -315,7 +316,46 @@ namespace Wabbajack
public void OnPropertyChanged(string name)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
if(PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
public string Error
{
get { return "Error"; }
}
public string this[string columnName]
{
get
{
return Validate(columnName);
}
}
private string Validate(string columnName)
{
string validationMessage = null;
switch (columnName)
{
case "Location":
if (Location == null)
{
validationMessage = null;
}
else if (Location != null && Directory.Exists(Location) && File.Exists(Path.Combine(Location, "modlist.txt")))
{
Location = Path.Combine(Location, "modlist.txt");
validationMessage = null;
ConfigureForBuild();
}
else
{
validationMessage = "Invalid Mod Organizer profile directory";
}
break;
}
return validationMessage;
}
private void UpdateLoop()
@ -421,18 +461,7 @@ namespace Wabbajack
else
{
var folder = UIUtils.ShowFolderSelectionDialog("Select Your MO2 profile directory");
if (folder != null)
{
var file = Path.Combine(folder, "modlist.txt");
if (!File.Exists(file))
{
Utils.Log($"No modlist.txt found at {file}");
}
Location = file;
ConfigureForBuild();
}
Location = folder;
}
}
@ -498,7 +527,7 @@ namespace Wabbajack
th.Priority = ThreadPriority.BelowNormal;
th.Start();
}
else
else if (_mo2Folder != null)
{
var compiler = new Compiler(_mo2Folder);
compiler.IgnoreMissingFiles = IgnoreMissingFiles;
@ -527,6 +556,12 @@ namespace Wabbajack
th.Priority = ThreadPriority.BelowNormal;
th.Start();
}
else
{
Utils.Log("Cannot compile modlist: no valid Mod Organizer profile directory selected.");
UIReady = true;
}
}
}
@ -537,5 +572,4 @@ namespace Wabbajack
public string Msg { get; internal set; }
public int ID { get; internal set; }
}
}
}

View File

@ -223,7 +223,7 @@ namespace Wabbajack
InstallDirectives = results.Where(i => !(i is IgnoredDirectly)).ToList();
Info("Getting nexus api_key please click authorize if a browser window appears");
Info("Getting Nexus api_key, please click authorize if a browser window appears");
if (IndexedArchives.Any(a => a.IniData?.General?.gameName != null))
{
@ -267,6 +267,15 @@ namespace Wabbajack
private void GenerateReport()
{
string css = "";
using (Stream cssStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Wabbajack.css-min.css"))
{
using (StreamReader reader = new StreamReader(cssStream))
{
css = reader.ReadToEnd();
}
}
using (var fs = File.OpenWrite($"{ModList.Name}.md"))
{
fs.SetLength(0);
@ -276,7 +285,8 @@ namespace Wabbajack
}
}
ModList.ReportHTML = CommonMarkConverter.Convert(File.ReadAllText($"{ModList.Name}.md"));
ModList.ReportHTML = "<style>"+css+"</style>"
+CommonMarkConverter.Convert(File.ReadAllText($"{ModList.Name}.md"));
}
/// <summary>
@ -426,7 +436,7 @@ namespace Wabbajack
}
else if (general.directURL != null && general.directURL.StartsWith("http://www.mediafire.com/file/"))
{
Error("Mediafire links are not currently supported");
Error("MediaFire links are not currently supported");
return null;
/*result = new MediaFireArchive()
{
@ -494,7 +504,7 @@ namespace Wabbajack
installer.NexusAPIKey = NexusKey;
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.");
$"Unable to resolve link for {found.Name}. If this is hosted on the Nexus the file may have been removed.");
return result;
}

View File

@ -78,7 +78,7 @@ namespace Wabbajack
if (Directory.Exists(Path.Combine(Outputfolder, "mods")))
{
if (MessageBox.Show(
"There already appears to be a Mod Organize 2 install in this folder, are you sure you wish to continue" +
"There already appears to be a Mod Organizer 2 install in this folder, are you sure you wish to continue" +
" with installation? If you do, you may render both your existing install and the new modlist inoperable.",
"Existing MO2 installation in install folder",
MessageBoxButton.YesNo,

View File

@ -64,8 +64,8 @@
<RowDefinition MinHeight="10" />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="MO2 Location:" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Location}" IsEnabled="{Binding UIReady}"/>
<Label Grid.Row="0" Content="MO2 Profile:" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Location, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" IsEnabled="{Binding UIReady}"/>
<Button Grid.Row="0" Content="Select" MinWidth="80" Grid.Column="2" Command="{Binding ChangePath}" IsEnabled="{Binding UIReady}"/>
<Label Grid.Row="2" Content="Download Location:" Grid.Column="0" />
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding DownloadLocation}" IsEnabled="{Binding UIReady}"/>

View File

@ -40,6 +40,7 @@ namespace Wabbajack
Utils.SetStatusFn((msg, progress) => WorkQueue.Report(msg, progress));
UIUtils.Dispatcher = Dispatcher;
_state._nexusSiteURL = "https://github.com/halgari/wabbajack";
new Thread(() =>
{

View File

@ -838,6 +838,9 @@
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=(Validation.HasError), RelativeSource={RelativeSource self}}" Value="True">
<Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
</DataTrigger>
<!--<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>

View File

@ -265,6 +265,12 @@
<ItemGroup>
<Resource Include="square_transparent_icon.ico" />
</ItemGroup>
<ItemGroup>
<None Include="css.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="css-min.css" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="banner.png" />
</ItemGroup>

1
Wabbajack/css-min.css vendored Normal file
View File

@ -0,0 +1 @@
*{margin:0;padding:0;border:0;font-size:100%;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;vertical-align:baseline;-webkit-text-size-adjust:none;padding-left:10px;padding-right:10px}ul{list-style:none}q{quotes:none}q:after,q:before{content:'';content:none}h1,h2,h3,h4,h5,h6{color:#555;font-weight:400;line-height:1.5;margin:0}h3{margin:1em 0 1em .5em;text-align:left;text-decoration:underline}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{color:inherit;text-decoration:none}h2{font-size:1.85em;font-weight:300}h3{font-size:1.75em}h4{font-size:1.5em}h5{font-size:.9em}h6{font-size:.7em}a{color:#6cc091;text-decoration:underline}a:hover{text-decoration:none}code{background:rgba(144,144,144,.075);border-radius:0;border:solid 1px #dbdbdb;font-family:"Courier New",monospace;font-size:.9em}

67
Wabbajack/css.css Normal file
View File

@ -0,0 +1,67 @@
* {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
vertical-align: baseline;
-webkit-text-size-adjust: none;
padding-left: 10px;
padding-right: 10px;
}
ul {
list-style: none;
}
q {
quotes: none;
}
q:before , q:after {
content: '';
content: none;
}
h1, h2, h3, h4, h5, h6 {
color: #555;
font-weight: 400;
line-height: 1.5;
margin: 0 0 0 0;
}
h3 {
margin: 1em 0 1em 0.5em;
text-align: left;
text-decoration: underline;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
color: inherit;
text-decoration: none;
}
h2 {
font-size: 1.85em;
font-weight: 300;
}
h3 {
font-size: 1.75em;
}
h4 {
font-size: 1.5em;
}
h5 {
font-size: 0.9em;
}
h6 {
font-size: 0.7em;
}
a {
color: #6cc091;
text-decoration: underline;
}
a:hover {
text-decoration: none;
}
code {
background: rgba(144, 144, 144, 0.075);
border-radius: 0;
border: solid 1px #dbdbdb;
font-family: "Courier New", monospace;
font-size: 0.9em;
}

View File

@ -10,7 +10,7 @@ pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
solution: 'Wabbajack.sln'
buildPlatform: 'x64'
buildConfiguration: 'Debug'