mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
#### Version - 2.5.3.25 - 6/24/2022
* Correctly modify Witcher 3 settings to the game accepts the values
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
### Changelog
|
||||
|
||||
#### Version - 2.5.3.25 - 6/24/2022
|
||||
* Correctly modify Witcher 3 settings to the game accepts the values
|
||||
|
||||
#### Version - 2.5.3.23 - 6/24/2022
|
||||
* Automatically set the screen resolution on Witcher 3 installs
|
||||
* Fix the launcher's error messages when run in bad folders
|
||||
|
@ -6,8 +6,8 @@
|
||||
<AssemblyName>wabbajack-cli</AssemblyName>
|
||||
<Company>Wabbajack</Company>
|
||||
<Platforms>x64</Platforms>
|
||||
<AssemblyVersion>2.5.3.23</AssemblyVersion>
|
||||
<FileVersion>2.5.3.23</FileVersion>
|
||||
<AssemblyVersion>2.5.3.24</AssemblyVersion>
|
||||
<FileVersion>2.5.3.24</FileVersion>
|
||||
<Copyright>Copyright © 2019-2022</Copyright>
|
||||
<Description>An automated ModList installer</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +0,0 @@
|
||||
<Application x:Class="Wabbajack.Launcher.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Wabbajack.Launcher"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Wabbajack.Launcher
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
@ -1,23 +0,0 @@
|
||||
<Window x:Class="Wabbajack.Launcher.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Wabbajack.Launcher"
|
||||
mc:Ignorable="d"
|
||||
Title="Wabbajack Launcher" Height="320" Width="600"
|
||||
WindowStyle="None"
|
||||
Background="#121212"
|
||||
BorderThickness="0"
|
||||
AllowsTransparency="False"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="275"></RowDefinition>
|
||||
<RowDefinition Height="45"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Image Grid.Row="0" Source="Wabba_Mouth_Small.png"></Image>
|
||||
<Label Grid.Row="1" Foreground="White" FontSize="20" Content="{Binding Status}"></Label>
|
||||
</Grid>
|
||||
</Window>
|
@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Wabbajack.Launcher
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
try
|
||||
{
|
||||
DataContext = new MainWindowVM();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
System.Console.Error.WriteLine("Error creating datacontext.");
|
||||
System.Console.Error.WriteLine(ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,229 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using Wabbajack.Launcher.Annotations;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Wabbajack.Launcher
|
||||
{
|
||||
public class MainWindowVM : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
private WebClient _client = new WebClient();
|
||||
public Uri GITHUB_REPO = new Uri("https://api.github.com/repos/wabbajack-tools/wabbajack/releases");
|
||||
|
||||
|
||||
[NotifyPropertyChangedInvocator]
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private string _status = "Checking for Updates";
|
||||
private Release _version;
|
||||
private List<string> _errors = new List<string>();
|
||||
|
||||
public string Status
|
||||
{
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
OnPropertyChanged("Status");
|
||||
}
|
||||
get
|
||||
{
|
||||
return _status;
|
||||
}
|
||||
}
|
||||
|
||||
public MainWindowVM()
|
||||
{
|
||||
Task.Run(CheckForUpdates);
|
||||
}
|
||||
|
||||
private async Task CheckForUpdates()
|
||||
{
|
||||
_client.Headers.Add ("user-agent", "Wabbajack Launcher");
|
||||
Status = "Selecting Release";
|
||||
|
||||
try
|
||||
{
|
||||
var releases = await GetReleases();
|
||||
_version = releases.OrderByDescending(r =>
|
||||
{
|
||||
if (r.Tag.Split(".").Length == 4 && Version.TryParse(r.Tag, out var v))
|
||||
return v;
|
||||
return new Version(0, 0, 0, 0);
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_errors.Add(ex.Message);
|
||||
await FinishAndExit();
|
||||
}
|
||||
|
||||
if (_version == null)
|
||||
{
|
||||
_errors.Add("Unable to parse Github releases");
|
||||
await FinishAndExit();
|
||||
}
|
||||
|
||||
Status = "Looking for Updates";
|
||||
|
||||
var base_folder = Path.Combine(Directory.GetCurrentDirectory(), _version.Tag);
|
||||
|
||||
if (File.Exists(Path.Combine(base_folder, "Wabbajack.exe")))
|
||||
{
|
||||
await FinishAndExit();
|
||||
}
|
||||
|
||||
var asset = _version.Assets.FirstOrDefault(a => a.Name == _version.Tag + ".zip");
|
||||
if (asset == null)
|
||||
{
|
||||
_errors.Add("No zip file for release " + _version.Tag);
|
||||
await FinishAndExit();
|
||||
}
|
||||
|
||||
var wc = new WebClient();
|
||||
wc.DownloadProgressChanged += UpdateProgress;
|
||||
Status = $"Downloading {_version.Tag} ...";
|
||||
byte[] data;
|
||||
try
|
||||
{
|
||||
data = await wc.DownloadDataTaskAsync(asset.BrowserDownloadUrl);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_errors.Add(ex.Message);
|
||||
// Something went wrong so fallback to original URL
|
||||
try
|
||||
{
|
||||
data = await wc.DownloadDataTaskAsync(asset.BrowserDownloadUrl);
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
_errors.Add(ex2.Message);
|
||||
await FinishAndExit();
|
||||
throw; // avoid unsigned variable 'data'
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (var zip = new ZipArchive(new MemoryStream(data), ZipArchiveMode.Read))
|
||||
{
|
||||
foreach (var entry in zip.Entries)
|
||||
{
|
||||
Status = $"Extracting: {entry.Name}";
|
||||
var outPath = Path.Combine(base_folder, entry.FullName);
|
||||
if (!Directory.Exists(Path.GetDirectoryName(outPath)))
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outPath));
|
||||
|
||||
if (entry.FullName.EndsWith("/") || entry.FullName.EndsWith("\\"))
|
||||
continue;
|
||||
await using var o = entry.Open();
|
||||
await using var of = File.Create(outPath);
|
||||
await o.CopyToAsync(of);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_errors.Add(ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
await FinishAndExit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task FinishAndExit()
|
||||
{
|
||||
try
|
||||
{
|
||||
Status = "Launching...";
|
||||
var wjFolder = Directory.EnumerateDirectories(Directory.GetCurrentDirectory())
|
||||
.OrderByDescending(v =>
|
||||
Version.TryParse(Path.GetFileName(v), out var ver) ? ver : new Version(0, 0, 0, 0))
|
||||
.FirstOrDefault();
|
||||
|
||||
var filename = Path.Combine(wjFolder, "Wabbajack.exe");
|
||||
await CreateBatchFile(filename);
|
||||
var info = new ProcessStartInfo
|
||||
{
|
||||
FileName = filename,
|
||||
Arguments = string.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(s => s.Contains(' ') ? '\"' + s + '\"' : s)),
|
||||
WorkingDirectory = wjFolder,
|
||||
};
|
||||
Process.Start(info);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
if (_errors.Count == 0)
|
||||
{
|
||||
Status = "Failed: Unknown error";
|
||||
await Task.Delay(10000);
|
||||
}
|
||||
foreach (var error in _errors)
|
||||
{
|
||||
Status = "Failed: " + error;
|
||||
await Task.Delay(10000);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CreateBatchFile(string filename)
|
||||
{
|
||||
filename = Path.Combine(Path.GetDirectoryName(filename), "wabbajack-cli.exe");
|
||||
var data = $"\"{filename}\" %*";
|
||||
var file = Path.Combine(Directory.GetCurrentDirectory(), "wabbajack-cli.bat");
|
||||
if (File.Exists(file) && await File.ReadAllTextAsync(file) == data) return;
|
||||
await File.WriteAllTextAsync(file, data);
|
||||
}
|
||||
|
||||
private void UpdateProgress(object sender, DownloadProgressChangedEventArgs e)
|
||||
{
|
||||
Status = $"Downloading {_version.Tag} ({e.ProgressPercentage}%)...";
|
||||
}
|
||||
|
||||
private async Task<Release[]> GetReleases()
|
||||
{
|
||||
Status = "Checking GitHub Repository";
|
||||
var data = await _client.DownloadStringTaskAsync(GITHUB_REPO);
|
||||
Status = "Parsing Response";
|
||||
return JsonConvert.DeserializeObject<Release[]>(data);
|
||||
}
|
||||
|
||||
|
||||
class Release
|
||||
{
|
||||
[JsonProperty("tag_name")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
[JsonProperty("assets")]
|
||||
public Asset[] Assets { get; set; }
|
||||
|
||||
}
|
||||
|
||||
class Asset
|
||||
{
|
||||
[JsonProperty("browser_download_url")]
|
||||
public Uri BrowserDownloadUrl { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 139 KiB |
Binary file not shown.
Before Width: | Height: | Size: 58 KiB |
@ -1,34 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyVersion>2.5.3.23</AssemblyVersion>
|
||||
<FileVersion>2.5.3.23</FileVersion>
|
||||
<Copyright>Copyright © 2019-2022</Copyright>
|
||||
<Description>Wabbajack Application Launcher</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<AssemblyName>Wabbajack</AssemblyName>
|
||||
<RootNamespace>Wabbajack</RootNamespace>
|
||||
<IncludeSymbolsInSingleFile>false</IncludeSymbolsInSingleFile>
|
||||
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
|
||||
<TrimMode>Link</TrimMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\Icons\wabbajack.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Wabba_Mouth_Small.png" />
|
||||
<Resource Include="Wabba_Mouth_Small.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -500,7 +500,7 @@ namespace Wabbajack.Lib
|
||||
var parser = new FileIniDataParser(new IniDataParser(config));
|
||||
var data = parser.ReadFile((string)file);
|
||||
data["Viewport"]["Resolution"] =
|
||||
$"{SystemParameters.ScreenWidth}x{SystemParameters.ScreenHeight}";
|
||||
$"\"{SystemParameters.ScreenWidth}x{SystemParameters.ScreenHeight}\"";
|
||||
parser.WriteFile((string)file, data);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -34,8 +34,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.Test", "Wabbajack
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.CLI", "Wabbajack.CLI\Wabbajack.CLI.csproj", "{685D8BB1-D178-4D2C-85C7-C54A36FB7454}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.Launcher", "Wabbajack.Launcher\Wabbajack.Launcher.csproj", "{D6856DBF-C959-4867-A8A8-343DA2D2715E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.Common.Test", "Wabbajack.Common.Test\Wabbajack.Common.Test.csproj", "{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wabbajack.App.Test", "Wabbajack.App.Test\Wabbajack.App.Test.csproj", "{44E30B97-D4A8-40A6-81D5-5CAB1F3D45CB}"
|
||||
@ -126,14 +124,6 @@ Global
|
||||
{685D8BB1-D178-4D2C-85C7-C54A36FB7454}.Release|Any CPU.Build.0 = Release|x64
|
||||
{685D8BB1-D178-4D2C-85C7-C54A36FB7454}.Release|x64.ActiveCfg = Release|x64
|
||||
{685D8BB1-D178-4D2C-85C7-C54A36FB7454}.Release|x64.Build.0 = Release|x64
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{D6856DBF-C959-4867-A8A8-343DA2D2715E}.Release|x64.Build.0 = Release|Any CPU
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Debug|Any CPU.ActiveCfg = Debug|x64
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Debug|Any CPU.Build.0 = Debug|x64
|
||||
{BA8A3E49-60D2-4BA2-B285-CB09FFDB6D32}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
@ -6,8 +6,8 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<Platforms>x64</Platforms>
|
||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||
<AssemblyVersion>2.5.3.23</AssemblyVersion>
|
||||
<FileVersion>2.5.3.23</FileVersion>
|
||||
<AssemblyVersion>2.5.3.24</AssemblyVersion>
|
||||
<FileVersion>2.5.3.24</FileVersion>
|
||||
<Copyright>Copyright © 2019-2022</Copyright>
|
||||
<Description>An automated ModList installer</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
@ -2,16 +2,12 @@ rmdir /q/s e:\Games\wabbajack_files
|
||||
mkdir e:\Games\wabbajack_files
|
||||
mkdir e:\Games\wabbajack_files\app
|
||||
mkdir e:\Games\wabbajack_files\cli
|
||||
mkdir e:\Games\wabbajack_files\launcher
|
||||
dotnet clean
|
||||
dotnet restore
|
||||
dotnet publish Wabbajack\Wabbajack.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o e:\Games\wabbajack_files\app --self-contained
|
||||
dotnet publish Wabbajack.Launcher\Wabbajack.Launcher.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o e:\Games\wabbajack_files\launcher --self-contained
|
||||
dotnet publish c:\oss\Wabbajack\Wabbajack.CLI\Wabbajack.CLI.csproj --runtime win10-x64 --configuration Release /p:Platform=x64 -o e:\Games\wabbajack_files\cli --self-contained
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com e:\Games\wabbajack_files\launcher\Wabbajack.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com e:\Games\wabbajack_files\app\Wabbajack.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com e:\Games\wabbajack_files\app\wabbajack-cli.exe
|
||||
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe" sign /t http://timestamp.sectigo.com e:\Games\wabbajack_files\cli\wabbajack-cli.exe
|
||||
"c:\Program Files\7-Zip\7z.exe" a e:\Games\wabbajack_files\app.zip e:\Games\wabbajack_files\app\*
|
||||
"c:\Program Files\7-Zip\7z.exe" a e:\Games\wabbajack_files\cli-3.0.zip e:\Games\wabbajack_files\cli\*
|
||||
copy e:\Games\wabbajack_files\launcher\Wabbajack.exe e:\Games\wabbajack_files\Wabbajack.exe
|
Reference in New Issue
Block a user