diff --git a/SA Tools.sln b/SA Tools.sln
index 655cf67a..3ff6cb39 100644
--- a/SA Tools.sln
+++ b/SA Tools.sln
@@ -97,8 +97,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OptimizeAnim", "CommandLine
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SA2ObjectDefinitions", "SA2Tools\SA2ObjectDefinitions\SA2ObjectDefinitions.csproj", "{7ACA31B9-31A0-48C0-95E2-2D5C9DBDDF93}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAToolsInstaller", "SAToolsInstaller\SAToolsInstaller.csproj", "{4B9222FF-2759-45EA-96C7-5B124074A61E}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WeldConverter", "CommandLine\WeldConverter\WeldConverter.csproj", "{864C2F8A-340B-4709-8F7F-A239EED9B11C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GameConfig", "GameConfig", "{CFE0A4B7-4D42-47A2-9749-6E2A622A8DE5}"
@@ -1416,18 +1414,6 @@ Global
{7ACA31B9-31A0-48C0-95E2-2D5C9DBDDF93}.Release|x64.Build.0 = Release|x64
{7ACA31B9-31A0-48C0-95E2-2D5C9DBDDF93}.Release|x86.ActiveCfg = Release|x86
{7ACA31B9-31A0-48C0-95E2-2D5C9DBDDF93}.Release|x86.Build.0 = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|Any CPU.ActiveCfg = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|Any CPU.Build.0 = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|x64.ActiveCfg = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|x64.Build.0 = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|x86.ActiveCfg = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Debug|x86.Build.0 = Debug|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|Any CPU.ActiveCfg = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|Any CPU.Build.0 = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|x64.ActiveCfg = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|x64.Build.0 = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|x86.ActiveCfg = Release|x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}.Release|x86.Build.0 = Release|x86
{864C2F8A-340B-4709-8F7F-A239EED9B11C}.Debug|Any CPU.ActiveCfg = Debug|x64
{864C2F8A-340B-4709-8F7F-A239EED9B11C}.Debug|Any CPU.Build.0 = Debug|x64
{864C2F8A-340B-4709-8F7F-A239EED9B11C}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/SAToolsInstaller/.vs/SAToolsInstaller.csproj.dtbcache.json b/SAToolsInstaller/.vs/SAToolsInstaller.csproj.dtbcache.json
deleted file mode 100644
index d829027e..00000000
--- a/SAToolsInstaller/.vs/SAToolsInstaller.csproj.dtbcache.json
+++ /dev/null
@@ -1 +0,0 @@
-{"RootPath":"D:\\GitHub\\sa_tools\\SAToolsInstaller","ProjectFileName":"SAToolsInstaller.csproj","Configuration":"Release|x86","FrameworkPath":"","Sources":[{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Updater\\LoaderDownloadDialog.cs"},{"SourceFile":"Updater\\LoaderManifestDialog.cs"},{"SourceFile":"Updater\\ModDownload.cs"},{"SourceFile":"Updater\\ModInfo.cs"},{"SourceFile":"Updater\\ModManifest.cs"},{"SourceFile":"Updater\\NativeMethods.cs"},{"SourceFile":"Updater\\ProgressDialog.cs"},{"SourceFile":"Updater\\ProgressDialog.Designer.cs"},{"SourceFile":"Updater\\SizeSuffix.cs"},{"SourceFile":"Updater\\UpdateMessageDialog.cs"},{"SourceFile":"Updater\\UpdateMessageDialog.Designer.cs"},{"SourceFile":"Updater\\UpdaterWebClient.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\x86\\Release\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"D:\\GitHub\\sa_tools\\packages\\Costura.Fody.5.7.0\\lib\\netstandard1.0\\Costura.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\Microsoft.Bcl.AsyncInterfaces.8.0.0\\lib\\net462\\Microsoft.Bcl.AsyncInterfaces.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\Microsoft.Win32.Primitives.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\NetCoreInstallChecker.3.0.1\\lib\\netstandard2.0\\NetCoreInstallChecker.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\NuGet.Versioning.6.5.0\\lib\\net472\\NuGet.Versioning.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.AppContext.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Buffers.4.5.1\\lib\\net461\\System.Buffers.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.ComponentModel.Composition.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Console.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Diagnostics.DiagnosticSource.7.0.1\\lib\\net462\\System.Diagnostics.DiagnosticSource.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Diagnostics.Tracing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Globalization.Calendars.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.IO.Compression.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.IO.Compression.FileSystem.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.IO.Compression.ZipFile.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.IO.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.IO.FileSystem.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.IO.FileSystem.Primitives.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Linq.Expressions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Memory.4.5.5\\lib\\net461\\System.Memory.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Net.Sockets.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Numerics.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Numerics.Vectors.4.5.0\\lib\\net46\\System.Numerics.Vectors.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Reflection.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Runtime.CompilerServices.Unsafe.6.0.0\\lib\\net461\\System.Runtime.CompilerServices.Unsafe.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Runtime.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Runtime.Extensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Runtime.InteropServices.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Runtime.InteropServices.RuntimeInformation.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Security.Cryptography.Algorithms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Security.Cryptography.Encoding.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Security.Cryptography.Primitives.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Security.Cryptography.X509Certificates.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Text.Encodings.Web.8.0.0\\lib\\net462\\System.Text.Encodings.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Text.Json.8.0.4\\lib\\net462\\System.Text.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\net461\\System.Threading.Tasks.Extensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"D:\\GitHub\\sa_tools\\packages\\System.ValueTuple.4.5.0\\lib\\net47\\System.ValueTuple.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Facades\\System.Xml.ReaderWriter.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"D:\\GitHub\\sa_tools\\SAToolsInstaller\\bin\\Release\\SAToolsInstaller.exe","OutputItemRelativePath":"SAToolsInstaller.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/SAToolsInstaller/App.config b/SAToolsInstaller/App.config
deleted file mode 100644
index f167edd5..00000000
--- a/SAToolsInstaller/App.config
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/FodyWeavers.xml b/SAToolsInstaller/FodyWeavers.xml
deleted file mode 100644
index 5029e706..00000000
--- a/SAToolsInstaller/FodyWeavers.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/FodyWeavers.xsd b/SAToolsInstaller/FodyWeavers.xsd
deleted file mode 100644
index 05e92c11..00000000
--- a/SAToolsInstaller/FodyWeavers.xsd
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks
-
-
-
-
- A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.
-
-
-
-
- A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks
-
-
-
-
- A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.
-
-
-
-
- A list of unmanaged 32 bit assembly names to include, delimited with line breaks.
-
-
-
-
- A list of unmanaged 64 bit assembly names to include, delimited with line breaks.
-
-
-
-
- The order of preloaded assemblies, delimited with line breaks.
-
-
-
-
-
- This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.
-
-
-
-
- Controls if .pdbs for reference assemblies are also embedded.
-
-
-
-
- Controls if runtime assemblies are also embedded.
-
-
-
-
- Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.
-
-
-
-
- Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.
-
-
-
-
- As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.
-
-
-
-
- Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.
-
-
-
-
- Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.
-
-
-
-
- A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |
-
-
-
-
- A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.
-
-
-
-
- A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |
-
-
-
-
- A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.
-
-
-
-
- A list of unmanaged 32 bit assembly names to include, delimited with |.
-
-
-
-
- A list of unmanaged 64 bit assembly names to include, delimited with |.
-
-
-
-
- The order of preloaded assemblies, delimited with |.
-
-
-
-
-
-
-
- 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
-
-
-
-
- A comma-separated list of error codes that can be safely ignored in assembly verification.
-
-
-
-
- 'false' to turn off automatic generation of the XML Schema file.
-
-
-
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/Program.cs b/SAToolsInstaller/Program.cs
deleted file mode 100644
index e22e2b67..00000000
--- a/SAToolsInstaller/Program.cs
+++ /dev/null
@@ -1,47 +0,0 @@
-using NetCoreInstallChecker;
-using NetCoreInstallChecker.Structs.Config;
-using NetCoreInstallChecker.Structs.Config.Enum;
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Windows.Forms;
-
-namespace SAToolsInstaller
-{
- static class Program
- {
- ///
- /// The main entry point for the application.
- ///
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- if (!Directory.Exists(".updates"))
- Directory.CreateDirectory(".updates");
- var finder = new FrameworkFinder(Environment.Is64BitOperatingSystem);
- var resolver = new DependencyResolver(finder);
- var framework = new Framework("Microsoft.WindowsDesktop.App", "7.0.3");
- var options = new RuntimeOptions("net7.0", framework, RollForwardPolicy.Minor);
- var result = resolver.Resolve(options);
-
- // Check if dependencies are missing.
- if (!result.Available)
- {
- if (MessageBox.Show(".NET 7.0 Desktop Runtime is not installed! Would you like to install it now?", "SA Tools Installer", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
- {
- MessageBox.Show("SA Tools cannot be installed without .NET 7.", "SA Tools Installer", MessageBoxButtons.OK, MessageBoxIcon.Error);
- return;
- }
- FrameworkDownloader frameworkDownloader = new FrameworkDownloader(framework.NuGetVersion, framework.FrameworkName);
- string url = frameworkDownloader.GetDownloadUrlAsync(Environment.Is64BitOperatingSystem ? Architecture.Amd64 : Architecture.x86).GetAwaiter().GetResult();
- SAToolsHub.Updater.UpdaterWebClient client = new SAToolsHub.Updater.UpdaterWebClient();
- client.DownloadFile(url, "NET7Install.exe");
- Process.Start(new ProcessStartInfo("NET7Install.exe", "/install /passive /norestart") { UseShellExecute = true, Verb = "runas" }).WaitForExit();
- }
- SAToolsHub.Updater.LoaderDownloadDialog mainForm = new SAToolsHub.Updater.LoaderDownloadDialog(Environment.Is64BitOperatingSystem ? "http://mm.reimuhakurei.net/SA%20Tools%20x64.7z" : "http://mm.reimuhakurei.net/SA%20Tools%20x86.7z", ".updates");
- Application.Run(mainForm);
- }
- }
-}
diff --git a/SAToolsInstaller/Properties/AssemblyInfo.cs b/SAToolsInstaller/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1077f51d..00000000
--- a/SAToolsInstaller/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("SAToolsInstaller")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("SAToolsInstaller")]
-[assembly: AssemblyCopyright("Copyright © 2022")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("4b9222ff-2759-45ea-96c7-5b124074a61e")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/SAToolsInstaller/Properties/Resources.Designer.cs b/SAToolsInstaller/Properties/Resources.Designer.cs
deleted file mode 100644
index d1f5c5d8..00000000
--- a/SAToolsInstaller/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-
-namespace SAToolsInstaller.Properties
-{
- ///
- /// A strongly-typed resource class, for looking up localized strings, etc.
- ///
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Returns the cached ResourceManager instance used by this class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SAToolsInstaller.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/SAToolsInstaller/Properties/Resources.resx b/SAToolsInstaller/Properties/Resources.resx
deleted file mode 100644
index af7dbebb..00000000
--- a/SAToolsInstaller/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/Properties/Settings.Designer.cs b/SAToolsInstaller/Properties/Settings.Designer.cs
deleted file mode 100644
index 02b45459..00000000
--- a/SAToolsInstaller/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-
-namespace SAToolsInstaller.Properties
-{
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/SAToolsInstaller/Properties/Settings.settings b/SAToolsInstaller/Properties/Settings.settings
deleted file mode 100644
index 39645652..00000000
--- a/SAToolsInstaller/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/SAToolsInstaller/SAToolsInstaller.csproj b/SAToolsInstaller/SAToolsInstaller.csproj
deleted file mode 100644
index 68a2a19b..00000000
--- a/SAToolsInstaller/SAToolsInstaller.csproj
+++ /dev/null
@@ -1,278 +0,0 @@
-
-
-
-
-
- Debug
- x86
- {4B9222FF-2759-45EA-96C7-5B124074A61E}
- WinExe
- SAToolsInstaller
- SAToolsInstaller
- v4.8
- 512
- true
- true
-
-
-
-
- x86
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- x86
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
- ..\packages\Costura.Fody.5.7.0\lib\netstandard1.0\Costura.dll
-
-
- ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
-
-
- ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll
- True
- True
-
-
- ..\packages\NetCoreInstallChecker.3.0.4\lib\netstandard2.0\NetCoreInstallChecker.dll
-
-
- ..\packages\NuGet.Versioning.6.11.1\lib\net472\NuGet.Versioning.dll
-
-
-
- ..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll
- True
- True
-
-
- ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
-
-
-
- ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll
- True
- True
-
-
-
- ..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll
-
-
- ..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll
- True
- True
-
-
- ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll
- True
- True
-
-
- ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll
- True
- True
-
-
- ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll
- True
- True
-
-
-
- ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll
- True
- True
-
-
- ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll
- True
- True
-
-
- ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll
- True
- True
-
-
- ..\packages\System.Linq.4.3.0\lib\net463\System.Linq.dll
- True
- True
-
-
- ..\packages\System.Linq.Expressions.4.3.0\lib\net463\System.Linq.Expressions.dll
- True
- True
-
-
- ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
-
-
- ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll
- True
- True
-
-
-
- ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
-
-
- ..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll
- True
- True
-
-
- ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll
- True
- True
-
-
- ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
-
-
- ..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll
- True
- True
-
-
- ..\packages\System.Runtime.InteropServices.4.3.0\lib\net463\System.Runtime.InteropServices.dll
- True
- True
-
-
- ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
- True
- True
-
-
- ..\packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll
- True
- True
-
-
- ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll
- True
- True
-
-
- ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll
- True
- True
-
-
- ..\packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll
- True
- True
-
-
- ..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll
-
-
- ..\packages\System.Text.Json.8.0.5\lib\net462\System.Text.Json.dll
-
-
- ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
-
-
- ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
-
-
-
-
-
-
-
-
-
-
- ..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll
- True
- True
-
-
-
-
-
-
- Form
-
-
- Form
-
-
-
-
-
-
- Form
-
-
- ProgressDialog.cs
-
-
-
- Form
-
-
- UpdateMessageDialog.cs
-
-
- Component
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
-
-
- ProgressDialog.cs
-
-
- UpdateMessageDialog.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/LoaderDownloadDialog.cs b/SAToolsInstaller/Updater/LoaderDownloadDialog.cs
deleted file mode 100644
index 96096dad..00000000
--- a/SAToolsInstaller/Updater/LoaderDownloadDialog.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using ModManagerCommon;
-using SAToolsHub;
-
-namespace SAToolsHub.Updater
-{
- public class LoaderDownloadDialog : ProgressDialog
- {
- private readonly string url;
- private readonly string updatePath;
- private readonly CancellationTokenSource tokenSource = new CancellationTokenSource();
-
- public LoaderDownloadDialog(string url, string updatePath)
- : base("Download Progress", true)
- {
- this.url = url;
- this.updatePath = updatePath;
-
- Shown += OnShown;
- CancelEvent += OnCancelEvent;
- }
-
- private void OnCancelEvent(object sender, EventArgs eventArgs)
- {
- tokenSource.Cancel();
- }
-
- private void OnShown(object sender, EventArgs eventArgs)
- {
- DialogResult = DialogResult.OK;
-
- SetTaskCount(1);
-
- using (var client = new UpdaterWebClient())
- {
- CancellationToken token = tokenSource.Token;
-
- void OnDownloadProgress(object o, DownloadProgressEventArgs args)
- {
- SetProgress(args.BytesReceived / (double)args.TotalBytesToReceive);
- SetTaskAndStep($"Downloading file:",
- $"({SizeSuffix.GetSizeSuffix(args.BytesReceived)} / {SizeSuffix.GetSizeSuffix(args.TotalBytesToReceive)})");
- args.Cancel = token.IsCancellationRequested;
- }
- void OnDownloadCompleted(object o, CancelEventArgs args)
- {
- NextTask();
- args.Cancel = token.IsCancellationRequested;
- }
-
- DialogResult result;
-
- SetTaskAndStep("Starting download...");
-
- do
- {
- result = DialogResult.Cancel;
-
- try
- {
- // poor man's await Task.Run (not available in .net 4.0)
- using (var task = new Task(() =>
- {
- var cancelArgs = new CancelEventArgs(false);
- DownloadProgressEventArgs downloadArgs = null;
-
- void DownloadComplete(object _sender, AsyncCompletedEventArgs args)
- {
- lock (args.UserState)
- {
- Monitor.Pulse(args.UserState);
- }
- }
-
- void DownloadProgressChanged(object _sender, DownloadProgressChangedEventArgs args)
- {
- downloadArgs = new DownloadProgressEventArgs(args, 1, 1);
- OnDownloadProgress(this, downloadArgs);
- if (downloadArgs.Cancel)
- {
- client.CancelAsync(); // This still doesn't work
- }
- }
-
- var uri = new Uri(url);
- string filePath = Path.Combine(updatePath, uri.Segments.Last());
-
- var info = new FileInfo(filePath);
- client.DownloadFileCompleted += DownloadComplete;
- client.DownloadProgressChanged += DownloadProgressChanged;
-
- var sync = new object();
- lock (sync)
- {
- client.DownloadFileAsync(uri, filePath, sync);
- Monitor.Wait(sync);
- }
-
- client.DownloadProgressChanged -= DownloadProgressChanged;
- client.DownloadFileCompleted -= DownloadComplete;
-
- if (cancelArgs.Cancel || downloadArgs?.Cancel == true)
- {
- return;
- }
-
- OnDownloadCompleted(this, cancelArgs);
- if (cancelArgs.Cancel)
- {
- return;
- }
-
- string dataDir = Path.Combine(updatePath, Path.GetFileNameWithoutExtension(filePath));
- if (!Directory.Exists(dataDir))
- {
- Directory.CreateDirectory(dataDir);
- }
-
- SetTaskAndStep("Extracting...");
- if (token.IsCancellationRequested)
- {
- return;
- }
-
- Process.Start(new ProcessStartInfo("7z.exe", $"x -aoa -o\"{dataDir}\" \"{filePath}\"") { UseShellExecute = false, CreateNoWindow = true }).WaitForExit();
-
- Process.Start(Path.Combine(dataDir, "SAToolsHub.exe"), $"doupdate \"{dataDir}\" \"{Path.GetDirectoryName(Application.ExecutablePath)}\"");
- }, token))
- {
- task.Start();
-
- while (!task.IsCompleted && !task.IsCanceled)
- {
- Application.DoEvents();
- }
-
- task.Wait(token);
- }
- }
- catch (AggregateException ae)
- {
- ae.Handle(ex =>
- {
- result = MessageBox.Show(this, $"Failed to update:\r\n{ ex.Message }",
- "Update Failed", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
- return true;
- });
- }
- } while (result == DialogResult.Retry);
-
- }
- }
-
- protected override void Dispose(bool disposing)
- {
- tokenSource.Dispose();
- base.Dispose(disposing);
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/LoaderManifestDialog.cs b/SAToolsInstaller/Updater/LoaderManifestDialog.cs
deleted file mode 100644
index 82ec0927..00000000
--- a/SAToolsInstaller/Updater/LoaderManifestDialog.cs
+++ /dev/null
@@ -1,156 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace SAToolsHub.Updater
-{
- public class LoaderManifestDialog : ProgressDialog
- {
- private readonly string updatePath;
- private readonly CancellationTokenSource tokenSource = new CancellationTokenSource();
-
- public LoaderManifestDialog(string updatePath)
- : base("Update Progress", true)
- {
- this.updatePath = updatePath;
-
- Shown += OnShown;
- CancelEvent += OnCancelEvent;
- }
-
- private void OnCancelEvent(object sender, EventArgs eventArgs)
- {
- tokenSource.Cancel();
- }
-
- private void OnShown(object sender, EventArgs eventArgs)
- {
- DialogResult = DialogResult.OK;
-
- SetTaskCount(1);
- SetProgress(1);
-
- CancellationToken token = tokenSource.Token;
- string originalPath = Directory.GetParent(Directory.GetParent(Path.GetDirectoryName(Application.ExecutablePath)).FullName).FullName;
- DialogResult result;
- do
- {
- result = DialogResult.Cancel;
-
- try
- {
- // poor man's await Task.Run (not available in .net 4.0)
- using (var task = new Task(() =>
- {
- string newManPath = Path.Combine(updatePath, "satools.manifest");
- string oldManPath = Path.Combine(originalPath, "satools.manifest");
-
- SetTaskAndStep("Parsing manifest...");
- if (token.IsCancellationRequested)
- {
- return;
- }
-
- List newManifest = ModManifest.FromFile(newManPath);
-
- SetTaskAndStep("Applying manifest...");
- if (token.IsCancellationRequested)
- {
- return;
- }
-
- if (File.Exists(oldManPath))
- {
- List oldManifest = ModManifest.FromFile(oldManPath);
- List oldFiles = oldManifest.Except(newManifest)
- .Select(x => x.FilePath)
- .ToList();
-
- foreach (string file in oldFiles)
- {
- if (File.Exists(file))
- {
- File.Delete(file);
- }
- }
-
- RemoveEmptyDirectories(oldManifest, newManifest);
- }
-
- foreach (ModManifestEntry file in newManifest)
- {
- string dir = Path.GetDirectoryName(file.FilePath);
- if (!string.IsNullOrEmpty(dir))
- {
- string newDir = dir;
- if (!Directory.Exists(newDir))
- {
- Directory.CreateDirectory(newDir);
- }
- }
-
- string dest = file.FilePath;
-
- if (File.Exists(dest))
- {
- File.Delete(dest);
- }
-
- File.Copy(Path.Combine(updatePath, file.FilePath), dest);
- }
-
- File.Copy(newManPath, oldManPath, true);
- Process.Start(Path.Combine(originalPath, Path.GetFileName(Application.ExecutablePath)), $"cleanupdate \"{updatePath}\"");
- }, token))
- {
- task.Start();
-
- while (!task.IsCompleted && !task.IsCanceled)
- {
- Application.DoEvents();
- }
-
- task.Wait(token);
- }
- }
- catch (AggregateException ae)
- {
- ae.Handle(ex =>
- {
- result = MessageBox.Show(this, $"Failed to update:\r\n{ex.Message}",
- "Update Failed", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
- return true;
- });
- }
- } while (result == DialogResult.Retry);
-
- Close();
- }
-
- private void RemoveEmptyDirectories(IEnumerable oldManifest, IEnumerable newManifest)
- {
- foreach (string dir in ModManifest.GetOldDirectories(oldManifest, newManifest))
- {
- if (Directory.Exists(dir))
- {
- // Note that this is very intentionally not recursive. If there are
- // any files left over somehow, this SHOULD be considered an error,
- // as the goal is to exclusively remove empty directories.
- // - SF94
- Directory.Delete(dir);
- }
- }
- }
-
- protected override void Dispose(bool disposing)
- {
- tokenSource.Dispose();
- base.Dispose(disposing);
- }
- }
-}
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/ModDownload.cs b/SAToolsInstaller/Updater/ModDownload.cs
deleted file mode 100644
index 992d7699..00000000
--- a/SAToolsInstaller/Updater/ModDownload.cs
+++ /dev/null
@@ -1,577 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Net;
-using System.Threading;
-using ModManagerCommon;
-using SAToolsHub;
-
-namespace SAToolsHub.Updater
-{
- public enum ModDownloadType
- {
- ///
- /// The mod is contained in a single archive file.
- ///
- Archive,
- ///
- /// The mod is hosted in a directory tree with
- /// individually accessible files.
- ///
- Modular
- }
-
- public class DownloadProgressEventArgs : CancelEventArgs
- {
- private readonly DownloadProgressChangedEventArgs args;
-
- public int ProgressPercentage => args.ProgressPercentage;
- public object UserState => args.UserState;
- public long BytesReceived => args.BytesReceived;
- public long TotalBytesToReceive => args.TotalBytesToReceive;
-
- public int FileDownloading { get; }
- public int FilesToDownload { get; }
-
- public DownloadProgressEventArgs(DownloadProgressChangedEventArgs args,
- int fileDownloading, int filesToDownload)
- {
- this.args = args;
- FileDownloading = fileDownloading;
- FilesToDownload = filesToDownload;
- }
- }
-
- public class ModDownload
- {
- public ModInfo Info { get; }
- public readonly ModDownloadType Type;
- public readonly string Url;
- public readonly string Folder;
- public readonly string Changes;
- public long Size { get; }
- public int FilesToDownload { get; }
- public List ChangedFiles { get; }
-
- public string HomePage = string.Empty;
- public string Name = string.Empty;
- public string Version = string.Empty;
- public DateTime Published;
- public DateTime Updated;
- public string ReleaseUrl = string.Empty;
-
- public event CancelEventHandler DownloadStarted;
- public event EventHandler DownloadProgress;
- public event CancelEventHandler DownloadCompleted;
- public event CancelEventHandler Extracting;
- public event CancelEventHandler ParsingManifest;
- public event CancelEventHandler ApplyingManifest;
-
- ///
- /// Constructs a ModDownload instance with the type ModDownloadType.Archive.
- ///
- /// Metadata for the associated mod.
- /// The folder containing the mod.
- /// URL of the mod download.
- /// List of changes for this update.
- /// Size of the archive to download.
- ///
- public ModDownload(ModInfo info, string folder, string url, string changes, long size)
- {
- Info = info;
- Type = ModDownloadType.Archive;
- Url = url;
- Folder = folder;
- Changes = changes;
- Size = size;
- FilesToDownload = 1;
- }
-
- ///
- /// Constructs a ModDownload instance with the type ModDownloadType.Modular.
- ///
- /// Metadata for the associated mod.
- /// The folder containing the mod.
- /// URL of the mod download.
- /// List of changes for this update.
- /// A diff of the remote and local manifests.
- ///
- public ModDownload(ModInfo info, string folder, string url, string changes, List diff)
- {
- Info = info;
- Type = ModDownloadType.Modular;
- Url = url;
- Folder = folder;
-
- ChangedFiles = diff?.Where(x => x.State != ModManifestState.Unchanged).ToList()
- ?? throw new ArgumentNullException(nameof(diff));
-
- List toDownload = ChangedFiles
- .Where(x => x.State == ModManifestState.Added || x.State == ModManifestState.Changed)
- .ToList();
-
- FilesToDownload = toDownload.Count;
- Size = Math.Max(toDownload.Select(x => x.Current.FileSize).Sum(), toDownload.Count);
-
- Changes = !string.IsNullOrEmpty(changes) ? changes : string.Empty;
- }
-
- ///
- /// Downloads files required for updating according to .
- ///
- /// to be used for downloading.
- /// Path to store downloaded files.
- public void Download(WebClient client, string updatePath)
- {
- var cancelArgs = new CancelEventArgs(false);
- DownloadProgressEventArgs downloadArgs = null;
-
- int fileDownloading = 0;
-
- void downloadComplete(object sender, AsyncCompletedEventArgs args)
- {
- lock (args.UserState)
- {
- Monitor.Pulse(args.UserState);
- }
- }
-
- void downloadProgressChanged(object sender, DownloadProgressChangedEventArgs args)
- {
- downloadArgs = new DownloadProgressEventArgs(args, fileDownloading, FilesToDownload);
- if (OnDownloadProgress(downloadArgs))
- {
- ((WebClient)sender).CancelAsync();
- }
- }
-
- switch (Type)
- {
- case ModDownloadType.Archive:
- {
- var uri = new Uri(Url);
- if (!uri.Host.EndsWith("github.com", StringComparison.OrdinalIgnoreCase))
- {
- var request = (HttpWebRequest)WebRequest.Create(uri);
- request.Method = "HEAD";
- var response = (HttpWebResponse)request.GetResponse();
- uri = response.ResponseUri;
- response.Close();
- }
-
- string filePath = Path.Combine(updatePath, uri.Segments.Last());
-
- var info = new FileInfo(filePath);
- if (info.Exists && info.Length == Size)
- {
- if (OnDownloadCompleted(cancelArgs))
- {
- return;
- }
- }
- else
- {
- if (OnDownloadStarted(cancelArgs))
- {
- return;
- }
-
- client.DownloadFileCompleted += downloadComplete;
- client.DownloadProgressChanged += downloadProgressChanged;
- ++fileDownloading;
-
- var sync = new object();
- lock (sync)
- {
- client.DownloadFileAsync(uri, filePath, sync);
- Monitor.Wait(sync);
- }
-
- client.DownloadProgressChanged -= downloadProgressChanged;
- client.DownloadFileCompleted -= downloadComplete;
-
- if (cancelArgs.Cancel || downloadArgs?.Cancel == true)
- {
- return;
- }
-
- if (OnDownloadCompleted(cancelArgs))
- {
- return;
- }
- }
-
- string dataDir = Path.Combine(updatePath, Path.GetFileNameWithoutExtension(filePath));
- if (!Directory.Exists(dataDir))
- {
- Directory.CreateDirectory(dataDir);
- }
-
- if (OnExtracting(cancelArgs))
- {
- return;
- }
-
- Process process = Process.Start(
- new ProcessStartInfo("7z.exe", $"x -aoa -o\"{dataDir}\" \"{filePath}\"")
- {
- UseShellExecute = false,
- CreateNoWindow = true
- });
-
- if (process != null)
- {
- process.WaitForExit();
- }
- else
- {
- throw new NullReferenceException("Failed to create 7z process");
- }
-
- string workDir = Path.GetDirectoryName(ModInfo.GetModFiles(new DirectoryInfo(dataDir)).FirstOrDefault());
-
- if (string.IsNullOrEmpty(workDir))
- {
- throw new DirectoryNotFoundException($"Unable to locate mod.ini in \"{dataDir}\"");
- }
-
- string newManPath = Path.Combine(workDir, "mod.manifest");
- string oldManPath = Path.Combine(Folder, "mod.manifest");
-
- if (OnParsingManifest(cancelArgs))
- {
- return;
- }
-
- if (!File.Exists(newManPath) || !File.Exists(oldManPath))
- {
- CopyDirectory(new DirectoryInfo(workDir), Directory.CreateDirectory(Folder));
- Directory.Delete(dataDir, true);
-
- if (File.Exists(filePath))
- {
- File.Delete(filePath);
- }
-
- return;
- }
-
- if (OnParsingManifest(cancelArgs))
- {
- return;
- }
-
- List newManifest = ModManifest.FromFile(newManPath);
-
- if (OnApplyingManifest(cancelArgs))
- {
- return;
- }
-
- List oldManifest = ModManifest.FromFile(oldManPath);
- List oldFiles = oldManifest.Except(newManifest)
- .Select(x => Path.Combine(Folder, x.FilePath))
- .ToList();
-
- foreach (string file in oldFiles)
- {
- if (File.Exists(file))
- {
- File.Delete(file);
- }
- }
-
- RemoveEmptyDirectories(oldManifest, newManifest);
-
- foreach (ModManifestEntry file in newManifest)
- {
- string dir = Path.GetDirectoryName(file.FilePath);
- if (!string.IsNullOrEmpty(dir))
- {
- string newDir = Path.Combine(Folder, dir);
- if (!Directory.Exists(newDir))
- {
- Directory.CreateDirectory(newDir);
- }
- }
-
- var sourceFile = new FileInfo(Path.Combine(workDir, file.FilePath));
- var destFile = new FileInfo(Path.Combine(Folder, file.FilePath));
-
- if (destFile.Exists)
- {
- destFile.Delete();
- }
-
- sourceFile.Attributes &= ~FileAttributes.ReadOnly;
- sourceFile.MoveTo(destFile.FullName);
- }
-
- File.Copy(newManPath, oldManPath, true);
-
- void removeReadOnly(DirectoryInfo dir)
- {
- foreach (DirectoryInfo d in dir.GetDirectories())
- {
- removeReadOnly(d);
- d.Attributes &= ~FileAttributes.ReadOnly;
- }
- }
-
- removeReadOnly(new DirectoryInfo(dataDir));
-
- Directory.Delete(dataDir, true);
- File.WriteAllText(Path.Combine(Folder, "mod.version"), Updated.ToString(DateTimeFormatInfo.InvariantInfo));
-
- if (File.Exists(filePath))
- {
- File.Delete(filePath);
- }
-
- break;
- }
-
- case ModDownloadType.Modular:
- {
- List newEntries = ChangedFiles
- .Where(x => x.State == ModManifestState.Added || x.State == ModManifestState.Changed)
- .ToList();
-
- var uri = new Uri(Url);
- string tempDir = Path.Combine(updatePath, uri.Segments.Last());
-
- if (!Directory.Exists(tempDir))
- {
- Directory.CreateDirectory(tempDir);
- }
-
- var sync = new object();
-
- foreach (ModManifestDiff i in newEntries)
- {
- string filePath = Path.Combine(tempDir, i.Current.FilePath);
- string dir = Path.GetDirectoryName(filePath);
-
- if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
- {
- Directory.CreateDirectory(dir);
- }
-
- if (OnDownloadStarted(cancelArgs))
- {
- return;
- }
-
- var info = new FileInfo(filePath);
- ++fileDownloading;
-
- if (!info.Exists || info.Length != i.Current.FileSize ||
- !i.Current.Checksum.Equals(ModManifestGenerator.GetFileHash(filePath), StringComparison.OrdinalIgnoreCase))
- {
- client.DownloadFileCompleted += downloadComplete;
- client.DownloadProgressChanged += downloadProgressChanged;
-
- lock (sync)
- {
- client.DownloadFileAsync(new Uri(uri, i.Current.FilePath), filePath, sync);
- Monitor.Wait(sync);
- }
-
- client.DownloadProgressChanged -= downloadProgressChanged;
- client.DownloadFileCompleted -= downloadComplete;
-
- info.Refresh();
-
- if (info.Length != i.Current.FileSize)
- {
- throw new Exception(string.Format("Size of downloaded file \"{0}\" ({1}) differs from manifest ({2}).",
- i.Current.FilePath, SizeSuffix.GetSizeSuffix(info.Length), SizeSuffix.GetSizeSuffix(i.Current.FileSize)));
- }
-
- string hash = ModManifestGenerator.GetFileHash(filePath);
- if (!i.Current.Checksum.Equals(hash, StringComparison.OrdinalIgnoreCase))
- {
- throw new Exception(string.Format("Checksum of downloaded file \"{0}\" ({1}) differs from manifest ({2}).",
- i.Current.FilePath, hash, i.Current.Checksum));
- }
- }
-
- if (cancelArgs.Cancel || downloadArgs?.Cancel == true)
- {
- return;
- }
-
- if (OnDownloadCompleted(cancelArgs))
- {
- return;
- }
- }
-
- client.DownloadFileCompleted += downloadComplete;
- lock (sync)
- {
- client.DownloadFileAsync(new Uri(uri, "mod.manifest"), Path.Combine(tempDir, "mod.manifest"), sync);
- Monitor.Wait(sync);
- }
-
- client.DownloadFileCompleted -= downloadComplete;
-
- // Handle all non-removal file operations (move, rename)
- List movedEntries = ChangedFiles.Except(newEntries)
- .Where(x => x.State == ModManifestState.Moved)
- .ToList();
-
- if (OnApplyingManifest(cancelArgs))
- {
- return;
- }
-
- // Handle existing entries marked as moved.
- foreach (ModManifestDiff i in movedEntries)
- {
- ModManifestEntry old = i.Last;
-
- // This would be considered an error...
- if (old == null)
- {
- continue;
- }
-
- string oldPath = Path.Combine(Folder, old.FilePath);
- string newPath = Path.Combine(tempDir, i.Current.FilePath);
-
- string dir = Path.GetDirectoryName(newPath);
-
- if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
- {
- Directory.CreateDirectory(dir);
- }
-
- File.Copy(oldPath, newPath, true);
- }
-
- // Now move the stuff from the temporary folder over to the working directory.
- foreach (ModManifestDiff i in newEntries.Concat(movedEntries))
- {
- string tempPath = Path.Combine(tempDir, i.Current.FilePath);
- string workPath = Path.Combine(Folder, i.Current.FilePath);
- string dir = Path.GetDirectoryName(workPath);
-
- if (!string.IsNullOrEmpty(dir) && !Directory.Exists(dir))
- {
- Directory.CreateDirectory(dir);
- }
-
- File.Copy(tempPath, workPath, true);
- }
-
- // Once that has succeeded we can safely delete files that have been marked for removal.
- List removedEntries = ChangedFiles
- .Where(x => x.State == ModManifestState.Removed)
- .ToList();
-
- foreach (string path in removedEntries.Select(i => Path.Combine(Folder, i.Current.FilePath)).Where(File.Exists))
- {
- File.Delete(path);
- }
-
- // Same for files that have been moved.
- foreach (string path in movedEntries
- .Where(x => newEntries.All(y => y.Current.FilePath != x.Last.FilePath))
- .Select(i => Path.Combine(Folder, i.Last.FilePath)).Where(File.Exists))
- {
- File.Delete(path);
- }
-
- string oldManPath = Path.Combine(Folder, "mod.manifest");
- string newManPath = Path.Combine(tempDir, "mod.manifest");
-
- if (File.Exists(oldManPath))
- {
- List oldManifest = ModManifest.FromFile(oldManPath);
- List newManifest = ModManifest.FromFile(newManPath);
-
- // Remove directories that are now empty.
- RemoveEmptyDirectories(oldManifest, newManifest);
- }
-
- // And last but not least, copy over the new manifest.
- File.Copy(newManPath, oldManPath, true);
- break;
- }
-
- default:
- throw new ArgumentOutOfRangeException();
- }
- }
-
- private void CopyDirectory(DirectoryInfo oldDir, DirectoryInfo newDir)
- {
- foreach (DirectoryInfo dir in oldDir.EnumerateDirectories())
- {
- CopyDirectory(dir, newDir.CreateSubdirectory(dir.Name));
- }
-
- foreach (FileInfo file in oldDir.EnumerateFiles())
- {
- file.CopyTo(Path.Combine(newDir.FullName, file.Name), true);
- }
- }
-
- private void RemoveEmptyDirectories(IEnumerable oldManifest, IEnumerable newManifest)
- {
- foreach (string dir in ModManifest.GetOldDirectories(oldManifest, newManifest)
- .Select(x => Path.Combine(Folder, x)))
- {
- if (Directory.Exists(dir))
- {
- // Note that this is very intentionally not recursive. If there are
- // any files left over somehow, this SHOULD be considered an error,
- // as the goal is to exclusively remove empty directories.
- // - SF94
- Directory.Delete(dir);
- }
- }
- }
-
- private bool OnDownloadStarted(CancelEventArgs e)
- {
- DownloadStarted?.Invoke(this, e);
- return e.Cancel;
- }
-
- private bool OnDownloadProgress(DownloadProgressEventArgs e)
- {
- DownloadProgress?.Invoke(this, e);
- return e.Cancel;
- }
-
- private bool OnDownloadCompleted(CancelEventArgs e)
- {
- DownloadCompleted?.Invoke(this, e);
- return e.Cancel;
- }
-
- private bool OnExtracting(CancelEventArgs e)
- {
- Extracting?.Invoke(this, e);
- return e.Cancel;
- }
-
- private bool OnParsingManifest(CancelEventArgs e)
- {
- ParsingManifest?.Invoke(this, e);
- return e.Cancel;
- }
-
- private bool OnApplyingManifest(CancelEventArgs e)
- {
- ApplyingManifest?.Invoke(this, e);
- return e.Cancel;
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/ModInfo.cs b/SAToolsInstaller/Updater/ModInfo.cs
deleted file mode 100644
index 07d5e234..00000000
--- a/SAToolsInstaller/Updater/ModInfo.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-
-namespace SAToolsHub.Updater
-{
- public class ModInfo
- {
- public string Name { get; set; }
- public string Author { get; set; }
- public string Version { get; set; }
- public string Description { get; set; }
- public string DLLFile { get; set; }
- public string Codes { get; set; }
- public string GitHubRepo { get; set; }
- public string GitHubAsset { get; set; }
- public string UpdateUrl { get; set; }
- public string ChangelogUrl { get; set; }
- public string GameBananaItemType { get; set; }
- public long? GameBananaItemId { get; set; }
-
- public static IEnumerable GetModFiles(DirectoryInfo directoryInfo)
- {
- string modini = Path.Combine(directoryInfo.FullName, "mod.ini");
- if (File.Exists(modini))
- {
- yield return modini;
- yield break;
- }
-
- foreach (DirectoryInfo item in directoryInfo.GetDirectories())
- {
- if (item.Name[0] == '.')
- {
- continue;
- }
-
- foreach (string filename in GetModFiles(item))
- yield return filename;
- }
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/ModManifest.cs b/SAToolsInstaller/Updater/ModManifest.cs
deleted file mode 100644
index 7a8738d8..00000000
--- a/SAToolsInstaller/Updater/ModManifest.cs
+++ /dev/null
@@ -1,547 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.IO;
-using System.Linq;
-using System.Security.Cryptography;
-
-namespace SAToolsHub.Updater
-{
- ///
- /// Represents the difference between two s.
- ///
- public enum ModManifestState
- {
- ///
- /// The file is unchanged.
- ///
- Unchanged,
- ///
- /// Indicates that a file has been moved, renamed, or both.
- ///
- Moved,
- ///
- /// The file has been modified in some way.
- ///
- Changed,
- ///
- /// The file has been added to the new manifest.
- ///
- Added,
- ///
- /// The file has been removed from the new manifest.
- ///
- Removed
- }
-
- ///
- /// Holds two instances of and their differences.
- ///
- ///
- public class ModManifestDiff
- {
- ///
- /// The state of the file.
- ///
- ///
- public readonly ModManifestState State;
- ///
- /// The newer of the two entries.
- ///
- public readonly ModManifestEntry Current;
- ///
- /// The older of the two entries.
- ///
- public readonly ModManifestEntry Last;
-
- public ModManifestDiff(ModManifestState state, ModManifestEntry current, ModManifestEntry last)
- {
- State = state;
- Current = current;
- Last = last;
- }
- }
-
- public class FilesIndexedEventArgs : EventArgs
- {
- public FilesIndexedEventArgs(int fileCount)
- {
- FileCount = fileCount;
- }
-
- public int FileCount { get; }
- }
-
- public class FileHashEventArgs : EventArgs
- {
- public FileHashEventArgs(string fileName, int fileIndex, int fileCount)
- {
- FileName = fileName;
- FileIndex = fileIndex;
- FileCount = fileCount;
- Cancel = false;
- }
-
- public string FileName { get; }
- public int FileIndex { get; }
- public int FileCount { get; }
- public bool Cancel { get; set; }
- }
-
- public class ModManifestGenerator
- {
- public event EventHandler FilesIndexed;
- public event EventHandler FileHashStart;
- public event EventHandler FileHashEnd;
-
- ///
- /// Generates a manifest for a given mod.
- ///
- /// The path to the mod directory.
- /// A list of .
- public List Generate(string modPath)
- {
- if (!Directory.Exists(modPath))
- {
- throw new DirectoryNotFoundException();
- }
-
- var result = new List();
-
- List fileIndex = Directory.EnumerateFiles(modPath, "*", SearchOption.AllDirectories)
- .Where(x => !string.IsNullOrEmpty(x) &&
- !Path.GetFileName(x).Equals("mod.manifest") &&
- !Path.GetFileName(x).Equals("mod.version"))
- .ToList();
-
- if (fileIndex.Count < 1)
- {
- return result;
- }
-
- OnFilesIndexed(new FilesIndexedEventArgs(fileIndex.Count));
-
- int index = 0;
-
- foreach (string f in fileIndex)
- {
- string relativePath = f.Substring(modPath.Length + 1);
- FileInfo file = GetFileInfo(f);
-
- ++index;
-
- var args = new FileHashEventArgs(relativePath, index, fileIndex.Count);
- OnFileHashStart(args);
-
- if (args.Cancel)
- {
- return null;
- }
-
- string hash = GetFileHash(f);
-
- args = new FileHashEventArgs(relativePath, index, fileIndex.Count);
- OnFileHashEnd(args);
-
- if (args.Cancel)
- {
- return null;
- }
-
- result.Add(new ModManifestEntry(relativePath, file.Length, hash));
- }
-
- return result;
- }
-
- ///
- /// Follows symbolic links and constructs a of the actual file.
- ///
- /// Path to the file.
- /// The of the real file.
- private static FileInfo GetFileInfo(string path)
- {
- var file = new FileInfo(path);
-
- if ((file.Attributes & FileAttributes.ReparsePoint) != 0)
- {
- string reparsed;
-
- try
- {
- reparsed = NativeMethods.GetFinalPathName(path);
- }
- catch (Win32Exception ex)
- {
- if (ex.NativeErrorCode == 2)
- {
- throw new FileNotFoundException();
- }
-
- throw;
- }
-
- file = new FileInfo(reparsed.Replace(@"\\?\", null));
- }
-
- return file;
- }
-
- ///
- /// Generates a diff of two mod manifests.
- ///
- /// The new manifest.
- /// The old manifest.
- /// A list of containing change information.
- public static List Diff(List newManifest, List oldManifest)
- {
- // TODO: handle copies instead of moves to reduce download requirements (or cache downloads by hash?)
-
- var result = new List();
-
- List old = oldManifest != null && oldManifest.Count > 0
- ? new List(oldManifest)
- : new List();
-
- foreach (ModManifestEntry entry in newManifest)
- {
- // First, check for an exact match. File path/name, hash, size; everything.
- ModManifestEntry exact = old.FirstOrDefault(x => Equals(x, entry));
-
- if (exact != null)
- {
- old.Remove(exact);
- result.Add(new ModManifestDiff(ModManifestState.Unchanged, entry, null));
- continue;
- }
-
- // There's no exact match, so let's search by checksum.
- List checksum = old.Where(x => x.Checksum.Equals(entry.Checksum, StringComparison.InvariantCultureIgnoreCase)).ToList();
-
- // If we've found matching checksums, we then need to check
- // the file path to see if it's been moved.
- if (checksum.Count > 0)
- {
- old.Remove(checksum[0]);
-
- if (checksum.All(x => x.FilePath != entry.FilePath))
- {
- old.Remove(old.FirstOrDefault(x => x.FilePath.Equals(entry.FilePath, StringComparison.InvariantCultureIgnoreCase)));
- result.Add(new ModManifestDiff(ModManifestState.Moved, entry, checksum[0]));
- continue;
- }
- }
-
- // If we've made it here, there's no matching checksums, so let's search
- // for matching paths. If a path matches, the file has been modified.
- ModManifestEntry nameMatch = old.FirstOrDefault(x => x.FilePath.Equals(entry.FilePath, StringComparison.InvariantCultureIgnoreCase));
-
- if (nameMatch != null)
- {
- old.Remove(nameMatch);
- result.Add(new ModManifestDiff(ModManifestState.Changed, entry, nameMatch));
- continue;
- }
-
- // In every other case, this file is newly added.
- result.Add(new ModManifestDiff(ModManifestState.Added, entry, null));
- }
-
- // All files that are still unique to the old manifest should be marked for removal.
- if (old.Count > 0)
- {
- result.AddRange(old.Select(x => new ModManifestDiff(ModManifestState.Removed, x, null)));
- }
-
- return result;
- }
-
- ///
- /// Verifies the integrity of a mod against a mod manifest.
- ///
- /// Path to the mod to verify.
- /// Manifest to check against.
- /// A list of containing change information.
- public List Verify(string modPath, List manifest)
- {
- var result = new List();
- int index = 0;
-
- foreach (ModManifestEntry m in manifest)
- {
- string filePath = Path.Combine(modPath, m.FilePath);
-
- ++index;
-
- var args = new FileHashEventArgs(m.FilePath, index, manifest.Count);
- OnFileHashStart(args);
-
- if (args.Cancel)
- {
- return null;
- }
-
- try
- {
- if (!File.Exists(filePath))
- {
- result.Add(new ModManifestDiff(ModManifestState.Removed, m, null));
- continue;
- }
-
- FileInfo info;
-
- try
- {
- info = GetFileInfo(filePath);
- }
- catch (FileNotFoundException)
- {
- result.Add(new ModManifestDiff(ModManifestState.Removed, m, null));
- continue;
- }
-
- if (info.Length != m.FileSize)
- {
- result.Add(new ModManifestDiff(ModManifestState.Changed, m, null));
- continue;
- }
-
- string hash = GetFileHash(filePath);
- if (!hash.Equals(m.Checksum, StringComparison.InvariantCultureIgnoreCase))
- {
- result.Add(new ModManifestDiff(ModManifestState.Changed, m, null));
- continue;
- }
-
- result.Add(new ModManifestDiff(ModManifestState.Unchanged, m, null));
- }
- finally
- {
- args = new FileHashEventArgs(m.FilePath, index, manifest.Count);
- OnFileHashEnd(args);
- }
-
- if (args.Cancel)
- {
- return null;
- }
- }
-
- return result;
- }
-
- ///
- /// Computes a SHA-256 hash of a given file
- ///
- /// Path to the file to hash.
- /// Lowercase string representation of the hash.
- public static string GetFileHash(string filePath)
- {
- byte[] hash;
-
- using (SHA256 sha = SHA256.Create())
- {
- using (FileStream stream = File.OpenRead(filePath))
- {
- hash = sha.ComputeHash(stream);
- }
- }
-
- return string.Concat(hash.Select(x => x.ToString("x2")));
- }
-
- private void OnFilesIndexed(FilesIndexedEventArgs e)
- {
- FilesIndexed?.Invoke(this, e);
- }
-
- private void OnFileHashStart(FileHashEventArgs e)
- {
- FileHashStart?.Invoke(this, e);
- }
-
- private void OnFileHashEnd(FileHashEventArgs e)
- {
- FileHashEnd?.Invoke(this, e);
- }
- }
-
- public static class ModManifest
- {
- ///
- /// Produces a mod manifest from a file.
- ///
- /// The path to the mod manifest file.
- /// List of
- public static List FromFile(string filePath)
- {
- string[] lines = File.ReadAllLines(filePath);
- return lines.Select(line => new ModManifestEntry(line)).ToList();
- }
-
- ///
- /// Parses a mod manifest file in string form and produces a mod manifest.
- ///
- /// The mod manifest file string to parse.
- /// List of
- public static List FromString(string str)
- {
- string[] lines = str.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
- return lines.Select(line => new ModManifestEntry(line)).ToList();
- }
-
- ///
- /// Writes a mod manifest to a file.
- ///
- /// The manifest to write.
- /// The file to write the manifest to.
- public static void ToFile(IEnumerable manifest, string filePath)
- {
- File.WriteAllLines(filePath, manifest.Select(x => x.ToString()));
- }
-
- ///
- /// Get all distinct directories from an old manifest which no longer exist in a new manifest.
- ///
- /// The old manifest.
- /// The new manifest.
- ///
- /// All distinct directories exclusive to in descending order
- /// sorted by number of directory separators, with platform-agnostic directory separators
- /// replaced with .
- ///
- public static IEnumerable GetOldDirectories(IEnumerable oldManifest, IEnumerable newManifest)
- {
- IEnumerable GetDistinctPaths(IEnumerable manifest)
- {
- return manifest.Select(x => Path.GetDirectoryName(x.FilePath))
- .Where(s => !string.IsNullOrEmpty(s))
- .Select(s => s.Replace('/', Path.DirectorySeparatorChar))
- .Distinct(StringComparer.OrdinalIgnoreCase);
- }
-
- HashSet GetAllDirectoriesRecursively(IEnumerable manifest)
- {
- var directories = new HashSet(StringComparer.OrdinalIgnoreCase);
-
- foreach (string newPath in GetDistinctPaths(manifest))
- {
- string path = newPath;
-
- do
- {
- // FIXME: We could probably bail out of this loop early if Add returns false.
- // Very minor performance optimization; don't have time to test.
- directories.Add(path);
-
- // Keep asking for and adding the parent directory until there isn't one.
- path = Path.GetDirectoryName(path);
- } while (!string.IsNullOrEmpty(path));
- }
-
- return directories;
- }
-
- // Collect all directories and their parent directories
- HashSet newDirectories = GetAllDirectoriesRecursively(newManifest);
- HashSet oldDirectories = GetAllDirectoriesRecursively(oldManifest);
-
- // Return all directories that exist only in the old manifest.
- return oldDirectories.Where(s => !newDirectories.Contains(s))
- .OrderByDescending(s => s.Count(c => c == Path.DirectorySeparatorChar));
- }
- }
-
- ///
- /// An entry in a mod manifest describing a file's path, size, and checksum.
- ///
- public class ModManifestEntry
- {
- ///
- /// The name/path of the file relative to the root of the mod directory.
- ///
- public readonly string FilePath;
- ///
- /// The size of the file in bytes.
- ///
- public readonly long FileSize;
- ///
- /// String representation of the SHA-256 checksum of the file.
- ///
- public readonly string Checksum;
-
- ///
- /// Parses a line from a mod manifest line and constructs a .
- ///
- ///
- /// The line to parse.
- /// Each field of the line must be separated by tab (\t) and contain 3 fields total.
- /// Expected format is: [name]\t[size]\t[checksum]
- ///
- /// Thrown when an invalid number of fields parsed from the line.
- /// Thrown when an absolute path is provided, or parent directory traversal was attempted ("..\").
- public ModManifestEntry(string line)
- {
- string[] fields = line.Split('\t');
- if (fields.Length != 3)
- {
- throw new ArgumentException($"Manifest line must have 3 fields. Provided: {fields.Length}", nameof(line));
- }
-
- FilePath = fields[0];
- FileSize = long.Parse(fields[1]);
- Checksum = fields[2];
-
- if (Path.IsPathRooted(FilePath))
- {
- throw new Exception($"Absolute paths are forbidden: {FilePath}");
- }
-
- if (FilePath.StartsWith(@"..\", StringComparison.Ordinal) || FilePath.Contains(@"\..\"))
- {
- throw new Exception($"Parent directory traversal is forbidden: {FilePath}");
- }
- }
-
- public ModManifestEntry(string filePath, long fileSize, string checksum)
- {
- FilePath = filePath;
- FileSize = fileSize;
- Checksum = checksum;
- }
-
- public override string ToString()
- {
- return $"{FilePath}\t{FileSize}\t{Checksum}";
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(this, obj))
- {
- return true;
- }
-
- if (!(obj is ModManifestEntry m))
- {
- return false;
- }
-
- return FileSize == m.FileSize &&
- FilePath.Equals(m.FilePath, StringComparison.OrdinalIgnoreCase) &&
- Checksum.Equals(m.Checksum, StringComparison.OrdinalIgnoreCase);
- }
-
- public override int GetHashCode()
- {
- unchecked
- {
- int hashCode = FilePath?.GetHashCode() ?? 0;
- hashCode = (hashCode * 397) ^ FileSize.GetHashCode();
- hashCode = (hashCode * 397) ^ (Checksum?.GetHashCode() ?? 0);
- return hashCode;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/NativeMethods.cs b/SAToolsInstaller/Updater/NativeMethods.cs
deleted file mode 100644
index 28608c3d..00000000
--- a/SAToolsInstaller/Updater/NativeMethods.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace SAToolsHub.Updater
-{
- public static class NativeMethods
- {
- private static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1);
-
- private const uint FILE_READ_EA = 0x0008;
- private const uint FILE_FLAG_BACKUP_SEMANTICS = 0x2000000;
-
- [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
- static extern uint GetFinalPathNameByHandle(IntPtr hFile, StringBuilder lpszFilePath, uint cchFilePath, uint dwFlags);
-
- [DllImport("kernel32.dll", SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- static extern bool CloseHandle(IntPtr hObject);
-
- [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- private static extern IntPtr CreateFile(
- string filename,
- [MarshalAs(UnmanagedType.U4)] uint access,
- [MarshalAs(UnmanagedType.U4)] FileShare share,
- IntPtr securityAttributes,
- [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition,
- [MarshalAs(UnmanagedType.U4)] uint flagsAndAttributes,
- IntPtr templateFile);
-
- public static string GetFinalPathName(string path)
- {
- IntPtr handle = CreateFile(path, FILE_READ_EA, FileShare.ReadWrite | FileShare.Delete, IntPtr.Zero,
- FileMode.Open, FILE_FLAG_BACKUP_SEMANTICS, IntPtr.Zero);
-
- if (handle == INVALID_HANDLE_VALUE)
- {
- throw new Win32Exception();
- }
-
- try
- {
- var sb = new StringBuilder(1024);
- uint result = GetFinalPathNameByHandle(handle, sb, 1024, 0);
-
- if (result == 0)
- {
- throw new Win32Exception();
- }
-
- return sb.ToString();
- }
- finally
- {
- CloseHandle(handle);
- }
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/ProgressDialog.Designer.cs b/SAToolsInstaller/Updater/ProgressDialog.Designer.cs
deleted file mode 100644
index ad66f736..00000000
--- a/SAToolsInstaller/Updater/ProgressDialog.Designer.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-namespace SAToolsHub.Updater
-{
- partial class ProgressDialog
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.progressBar = new System.Windows.Forms.ProgressBar();
- this.labelTask = new System.Windows.Forms.Label();
- this.labelStep = new System.Windows.Forms.Label();
- this.buttonCancel = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // progressBar
- //
- this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.progressBar.Location = new System.Drawing.Point(12, 39);
- this.progressBar.Maximum = 2147483646;
- this.progressBar.Name = "progressBar";
- this.progressBar.Size = new System.Drawing.Size(344, 23);
- this.progressBar.Step = 1;
- this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
- this.progressBar.TabIndex = 3;
- //
- // labelTask
- //
- this.labelTask.AutoEllipsis = true;
- this.labelTask.Location = new System.Drawing.Point(12, 9);
- this.labelTask.Name = "labelTask";
- this.labelTask.Size = new System.Drawing.Size(344, 13);
- this.labelTask.TabIndex = 1;
- this.labelTask.Text = "labelTask";
- //
- // labelStep
- //
- this.labelStep.AutoEllipsis = true;
- this.labelStep.Location = new System.Drawing.Point(12, 23);
- this.labelStep.Name = "labelStep";
- this.labelStep.Size = new System.Drawing.Size(344, 13);
- this.labelStep.TabIndex = 2;
- this.labelStep.Text = "labelStep";
- //
- // buttonCancel
- //
- this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
- this.buttonCancel.Location = new System.Drawing.Point(281, 68);
- this.buttonCancel.Name = "buttonCancel";
- this.buttonCancel.Size = new System.Drawing.Size(75, 23);
- this.buttonCancel.TabIndex = 4;
- this.buttonCancel.Text = "&Cancel";
- this.buttonCancel.UseVisualStyleBackColor = true;
- this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
- //
- // ProgressDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.AutoSize = true;
- this.CancelButton = this.buttonCancel;
- this.ClientSize = new System.Drawing.Size(368, 103);
- this.ControlBox = false;
- this.Controls.Add(this.buttonCancel);
- this.Controls.Add(this.labelStep);
- this.Controls.Add(this.labelTask);
- this.Controls.Add(this.progressBar);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "ProgressDialog";
- this.ShowIcon = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "ProgressDialog";
- this.Load += new System.EventHandler(this.ProgressDialog_Load);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.ProgressBar progressBar;
- private System.Windows.Forms.Label labelTask;
- private System.Windows.Forms.Label labelStep;
- private System.Windows.Forms.Button buttonCancel;
- }
-}
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/ProgressDialog.cs b/SAToolsInstaller/Updater/ProgressDialog.cs
deleted file mode 100644
index 6a328a33..00000000
--- a/SAToolsInstaller/Updater/ProgressDialog.cs
+++ /dev/null
@@ -1,206 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace SAToolsHub.Updater
-{
- public partial class ProgressDialog : Form
- {
- public event EventHandler CancelEvent;
- #region Accessors
-
- ///
- /// Gets or sets the current task displayed on the window. (Upper label)
- ///
- public string CurrentTask => labelTask.Text;
-
- ///
- /// Gets or sets the current step displayed on the window. (Lower label)
- ///
- public string CurrentStep => labelStep.Text;
-
- ///
- /// Gets or sets the title of the window.
- ///
- public string Title
- {
- get => Text;
- set => Text = value;
- }
-
- // HACK: This is a work around for slow progress bar animation.
- private int progressValue
- {
- get => progressBar.Value;
- set
- {
- if (value > progressBar.Maximum)
- {
- progressBar.Value = progressBar.Maximum;
- return;
- }
-
- ++progressBar.Maximum;
- progressBar.Value = value + 1;
- progressBar.Value = value;
- --progressBar.Maximum;
- }
- }
-
- #endregion
-
- private int taskCount;
- private int taskIndex;
- private double multiplier;
- private bool closing;
-
- ///
- /// Initializes a ProgressDialog which displays the current task, the step in that task, and a progress bar.
- ///
- /// The title of the window
- /// Number of tasks this dialog will handle.
- /// Enables or disables the cancel button.
- public ProgressDialog(string title, int taskCount, bool allowCancel)
- : this(title, allowCancel)
- {
- SetTaskCount(taskCount);
- }
-
- ///
- /// Initializes a ProgressDialog which displays the current task, the step in that task, and a progress bar.
- ///
- /// The title of the window
- /// Enables or disables the cancel button.
- public ProgressDialog(string title, bool allowCancel)
- {
- InitializeComponent();
-
- Title = title;
- labelTask.Text = "";
- labelStep.Text = "";
- buttonCancel.Enabled = allowCancel;
- }
-
- public void SetTaskCount(int count)
- {
- if (closing) return;
- if (InvokeRequired)
- {
- Invoke((Action)SetTaskCount, count);
- return;
- }
-
- taskCount = count;
- multiplier = progressBar.Maximum / (double)count;
- }
-
- public void NextTask()
- {
- closing = true;
- if (InvokeRequired)
- {
- Invoke((Action)NextTask);
- return;
- }
-
- if (taskIndex + 1 < taskCount)
- {
- ++taskIndex;
- progressValue = (int)(taskIndex * multiplier);
- return;
- }
-
- progressBar.Value = progressBar.Maximum;
- Close();
- }
-
- public void SetProgress(double value)
- {
- if (closing) return;
- if (InvokeRequired)
- {
- Invoke((Action)SetProgress, value);
- return;
- }
-
- progressValue = (int)(taskIndex * multiplier + value * multiplier);
- }
-
- ///
- /// Sets the current task to display on the window. (Upper label)
- ///
- /// The string to display as the task.
- public void SetTask(string text)
- {
- if (closing) return;
- if (InvokeRequired)
- {
- Invoke((Action)SetTask, text);
- }
- else
- {
- labelTask.Text = text;
- }
- }
-
- ///
- /// Sets the current step to display on the window. (Lower label)
- ///
- /// The string to display as the step.
- public void SetStep(string text)
- {
- if (closing) return;
- if (InvokeRequired)
- {
- Invoke((Action)SetStep, text);
- }
- else
- {
- labelStep.Text = text;
- }
- }
-
- ///
- /// Sets the task and step simultaneously.
- /// Both parameters default to null, so you may also use this to clear them.
- ///
- /// The string to display as the task. (Upper label)
- /// The string to display as the step. (Lower label)
- public void SetTaskAndStep(string task = null, string step = null)
- {
- if (closing) return;
- if (InvokeRequired)
- {
- Invoke((Action)SetTaskAndStep, task, step);
- }
- else
- {
- labelTask.Text = task;
- labelStep.Text = step;
- }
- }
-
- private void ProgressDialog_Load(object sender, EventArgs e)
- {
- CenterToParent();
- buttonCancel.Select();
- }
-
- private void buttonCancel_Click(object sender, EventArgs e)
- {
- if (MessageBox.Show(this, "Are you sure you want to cancel?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
- {
- DialogResult = DialogResult.None;
- return;
- }
-
- OnCancelEvent();
- DialogResult = DialogResult.Cancel;
- Close();
- }
-
- protected virtual void OnCancelEvent()
- {
- CancelEvent?.Invoke(this, EventArgs.Empty);
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/ProgressDialog.resx b/SAToolsInstaller/Updater/ProgressDialog.resx
deleted file mode 100644
index 1af7de15..00000000
--- a/SAToolsInstaller/Updater/ProgressDialog.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/SizeSuffix.cs b/SAToolsInstaller/Updater/SizeSuffix.cs
deleted file mode 100644
index 68b66e25..00000000
--- a/SAToolsInstaller/Updater/SizeSuffix.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-using System;
-
-namespace ModManagerCommon
-{
- // Source: http://stackoverflow.com/questions/14488796/does-net-provide-an-easy-way-convert-bytes-to-kb-mb-gb-etc
-
- public static class SizeSuffix
- {
- private static readonly string[] sizeSuffixes =
- { "bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
-
- public static string GetSizeSuffix(long value, int decimalPlaces = 2)
- {
- if (value < 0) { return "-" + GetSizeSuffix(-value); }
- if (value == 0) { return "0.0 bytes"; }
-
- // mag is 0 for bytes, 1 for KB, 2, for MB, etc.
- int mag = (int)Math.Log(value, 1024);
-
- // 1L << (mag * 10) == 2 ^ (10 * mag)
- // [i.e. the number of bytes in the unit corresponding to mag]
- decimal adjustedSize = (decimal)value / (1L << (mag * 10));
-
- // make adjustment when the value is large enough that
- // it would round up to 1000 or more
- if (Math.Round(adjustedSize, decimalPlaces) >= 1000)
- {
- mag += 1;
- adjustedSize /= 1024;
- }
-
- return string.Format("{0:n" + decimalPlaces + "} {1}",
- adjustedSize,
- sizeSuffixes[mag]);
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/UpdateMessageDialog.Designer.cs b/SAToolsInstaller/Updater/UpdateMessageDialog.Designer.cs
deleted file mode 100644
index be63f488..00000000
--- a/SAToolsInstaller/Updater/UpdateMessageDialog.Designer.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-namespace SAToolsHub.Updater
-{
- partial class UpdateMessageDialog
- {
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- ///
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- ///
- private void InitializeComponent()
- {
- this.label1 = new System.Windows.Forms.Label();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.noButton = new System.Windows.Forms.Button();
- this.yesButton = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(12, 9);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(170, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "The following updates were found:";
- //
- // textBox1
- //
- this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.textBox1.Location = new System.Drawing.Point(12, 25);
- this.textBox1.Multiline = true;
- this.textBox1.Name = "textBox1";
- this.textBox1.ReadOnly = true;
- this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.textBox1.Size = new System.Drawing.Size(260, 183);
- this.textBox1.TabIndex = 1;
- //
- // label2
- //
- this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(12, 211);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(193, 13);
- this.label2.TabIndex = 2;
- this.label2.Text = "Do you want to download the updates?";
- //
- // noButton
- //
- this.noButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.noButton.DialogResult = System.Windows.Forms.DialogResult.No;
- this.noButton.Location = new System.Drawing.Point(197, 227);
- this.noButton.Name = "noButton";
- this.noButton.Size = new System.Drawing.Size(75, 23);
- this.noButton.TabIndex = 3;
- this.noButton.Text = "&No";
- this.noButton.UseVisualStyleBackColor = true;
- //
- // yesButton
- //
- this.yesButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.yesButton.DialogResult = System.Windows.Forms.DialogResult.Yes;
- this.yesButton.Location = new System.Drawing.Point(116, 227);
- this.yesButton.Name = "yesButton";
- this.yesButton.Size = new System.Drawing.Size(75, 23);
- this.yesButton.TabIndex = 4;
- this.yesButton.Text = "&Yes";
- this.yesButton.UseVisualStyleBackColor = true;
- //
- // UpdateMessageDialog
- //
- this.AcceptButton = this.yesButton;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.noButton;
- this.ClientSize = new System.Drawing.Size(284, 262);
- this.Controls.Add(this.yesButton);
- this.Controls.Add(this.noButton);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.textBox1);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "UpdateMessageDialog";
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Mod Manager";
- this.Load += new System.EventHandler(this.UpdateMessageDialog_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox textBox1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Button noButton;
- private System.Windows.Forms.Button yesButton;
- }
-}
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/UpdateMessageDialog.cs b/SAToolsInstaller/Updater/UpdateMessageDialog.cs
deleted file mode 100644
index 687b6666..00000000
--- a/SAToolsInstaller/Updater/UpdateMessageDialog.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Windows.Forms;
-
-namespace SAToolsHub.Updater
-{
- public partial class UpdateMessageDialog : Form
- {
- string message;
-
- public UpdateMessageDialog(string name, string message)
- {
- InitializeComponent();
- this.Text = "SA Tools";
- this.message = message;
- }
-
- private void UpdateMessageDialog_Load(object sender, EventArgs e)
- {
- textBox1.Text = message;
- }
- }
-}
diff --git a/SAToolsInstaller/Updater/UpdateMessageDialog.resx b/SAToolsInstaller/Updater/UpdateMessageDialog.resx
deleted file mode 100644
index 1af7de15..00000000
--- a/SAToolsInstaller/Updater/UpdateMessageDialog.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/SAToolsInstaller/Updater/UpdaterWebClient.cs b/SAToolsInstaller/Updater/UpdaterWebClient.cs
deleted file mode 100644
index 4572f1bb..00000000
--- a/SAToolsInstaller/Updater/UpdaterWebClient.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Net;
-
-namespace SAToolsHub.Updater
-{
- public class UpdaterWebClient : WebClient
- {
- protected override WebRequest GetWebRequest(Uri address)
- {
- var request = base.GetWebRequest(address) as HttpWebRequest;
-
- if (request != null)
- {
- request.UserAgent = "sa-tools";
- request.Timeout = 5000;
- }
-
- return request;
- }
- }
-}
diff --git a/SAToolsInstaller/packages.config b/SAToolsInstaller/packages.config
deleted file mode 100644
index 0a66ebd0..00000000
--- a/SAToolsInstaller/packages.config
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file