From bc3d3b333a070beac4110b252cb9a01b445c9c40 Mon Sep 17 00:00:00 2001 From: HarbingerOfMe Date: Sun, 27 Dec 2020 13:56:42 +0100 Subject: [PATCH] Don't generate more MMHOOK files if one already exists --- HookGenPatcher.cs | 10 ++++++++++ Properties/AssemblyInfo.cs | 16 +++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/HookGenPatcher.cs b/HookGenPatcher.cs index 3cd7efd..ee96a48 100644 --- a/HookGenPatcher.cs +++ b/HookGenPatcher.cs @@ -22,6 +22,16 @@ public static void Initialize() string pathIn = Path.Combine(Paths.ManagedPath, "Assembly-CSharp.dll"); string pathOut = Path.Combine(Paths.PluginPath, "MMHOOK_Assembly-CSharp.dll"); + foreach(string mmhookFile in Directory.EnumerateFiles(Paths.PluginPath, "MMHOOK_Assembly-CSharp.dll",SearchOption.AllDirectories)) + { + if (Path.GetFileName(mmhookFile).Equals("MMHOOK_Assembly-CSharp.dll")) + { + pathOut = mmhookFile; + Logger.LogInfo("Previous MMHOOK location found. Using that location to save instead."); + break; + } + } + var size = new FileInfo(pathIn).Length; if (File.Exists(pathOut)) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 903ddb7..b6748fd 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System.Resources; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -6,12 +7,12 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Bepinex.Monomod.HookGenPatcher")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Runtime hookgen for bepinex")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("HarbingerOfMe")] [assembly: AssemblyProduct("Bepinex.Monomod.HookGenPatcher")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] +[assembly: AssemblyCopyright("HarbingerOfMe2020")] +[assembly: AssemblyTrademark("MIT")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -32,5 +33,6 @@ // 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")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] +[assembly: NeutralResourcesLanguage("")]